SShortSingh.
Back to feed

Flutter app fixes sync bug where stale local data overwrote newer cloud edits

0
·1 views

A developer building an offline-first Flutter task app found that edits made on one device were being reverted by stale data from another after launch. The root cause was a startup routine that blindly pushed all local tasks to Firebase, combined with a weak heuristic for determining which version was newer. To fix this, they added a dedicated modifiedAt timestamp to each task that updates on every local edit. They also introduced a per-user upload watermark so that only tasks changed since the last successful upload are considered. The result is a last-write-wins sync strategy that compares timestamps before deciding what to upload.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

Python check flags shifted columns and empty rows in PDF-extracted tables

PDF table extraction can look correct on screen yet fail downstream when merged cells shift columns, headers get read as data, or page breaks drop rows. The article presents a short pdfplumber-based script that runs right after extraction to check table structure. The check flags rows with inconsistent cell counts, fully empty rows, and headers that don't match an expected column list. It cannot detect well-formed values that are simply wrong, so the author suggests comparing totals against the source. For tables with merged headers, the author recommends explicit table_settings and running the check per header block.

0
ProgrammingDEV Community ·

Only 28 US States Set a 180-Day School Year, a New Survey of All 51 Rules Finds

A new dataset compiled from current state law and board rules for all 50 states and DC shows that the common assumption of a 180-day school year is not universal. Only 28 states write 180 days into their rules, while 12 set no statewide day count and instead require a minimum number of instructional hours. Requirements vary widely, from Colorado's 160-day minimum to Kansas's 186 days for grades K-11, and Texas measures instruction in minutes. The creators released the data as a free CSV and JSON file, with the table also available on GradeKind, and note that Oregon and West Virginia have pending rule changes.

0
ProgrammingDEV Community ·

Essay Argues AI Could Write Novels with Structures Beyond Human Cognition

An essay on DEV Community contends that the most interesting post-human literature would not simply be an AI-written novel but one whose structure no human mind could conceive. It notes that human readers and writers are limited in how many characters, plot threads, and themes they can track at once, while a novel could in principle involve thousands of interlinked characters and multidimensional plot constraints. The author distinguishes three senses of impossibility for such a structure: combinatorial, cognitive, and aesthetic. The piece says the first is already achievable with AI, while the others remain frontier and speculative goals. It also challenges the assumption that literature must center on human experience.

0
ProgrammingDEV Community ·

Engineering a Site Model Pipeline Across Five Tools Hinges on Shared Control Points

The article argues that site modeling teams should evaluate the workflow between tools rather than their individual features. It stresses that every project must establish a fixed control point, with datum, coordinate system, and units defined, so separately produced models can be combined. GenAnywhere is described as producing terrain surfaces that keep their identity through edits, which allows grading studies to be versioned inputs. MicroStation is presented as the authoritative geometry store that enforces standards and records changes for auditability. The piece highlights concurrency as the main challenge for CityWeft, where multiple authors edit scenario layers simultaneously.