Repository navigation
Conversation
…again FlashPageWalSyncImpl lists a Limitless pendant's flash backlog as one recording and estimated its start as now minus its duration every time it listed the pendant: on connect, on every discovery wake and after every sync pass. Wal.id is device_timerStart, so the same recording got a new id each time, and whatever held it by id lost it: the recording details page (SyncProvider.getWalById) kept showing a stale copy, and deleteWal ignored a delete for it. Keep the start estimated when the backlog was listed for as long as it still starts at the same page of the same pendant. A transfer that stopped part-way moves the listed recording's start page in place, so it keeps its id too. The two device reads of the listing now use the existing testConnection seam, as _syncWal already does, so the test can drive the real listing. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Git-on-my-level
left a comment
There was a problem hiding this comment.
Approving — the production change is correct, tightly scoped, and well tested.
- app/lib/services/wals/flash_page_wal_sync.dart:182-183 — the core fix reuses the timerStart of the listed recording matching device + storageOffset == oldest_flash_page, so a relisted backlog keeps its device_timerStart-derived id. I traced both resume paths: a longer backlog with the same first page keeps the id and grows seconds/storageTotalBytes, and a partial transfer advances wal.storageOffset past acknowledged pages while keeping timerStart, so the remainder keeps its id too — both are asserted in the new tests.
- The testConnection seam (lines 102, 185) mirrors the existing @VisibleForTesting pattern in storage_sync.dart / sdcard_wal_sync.dart / ring_storage_sync.dart; no production call site sets it.
- app/test/unit/flash_page_wal_listing_test.dart — drives the real listing path via refreshWalsFromDevice with the clock moved on between listings, plus growth and partial-transfer-resume cases; hermetic (mock SharedPreferences, fake pendant).
- .github/failure-classes/FC-relisted-identity-derived-from-clock.json — schema-valid, and the canonical prevention artifact points at the new test (scripts/test_failure_class.py passes with it).
- app/changelog/unreleased/20261019-limitless-recording-start-time.json — matches the existing fragment format.
Performance: one in-memory list scan per listing — negligible. UX: Offline Sync rows stop churning on every reconnect/wake, and open/delete on a pending recording now target the right entry. Blast radius: Limitless pendants with >30 pending flash pages outside Transcribe Later mode.
USER IMPACT: A pending Limitless (Offline Sync) recording now keeps its start time and identity across reconnects and sync passes, so opening or deleting it works reliably instead of acting on a stale copy.
Non-blocking follow-ups I'd still want someday: id stability is session-scoped (_wals is in-memory, so an app restart still re-estimates from the clock — same as before this PR; persisting a first-page-to-timerStart mapping would be the next step if cross-launch stability matters), and nothing yet covers the relist-after-delete path.
by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.
kodjima33
left a comment
There was a problem hiding this comment.
Fixes a real bug (Limitless recording re-listed with a new id each pass, losing tombstone/delete tracking). Scoped diff, root cause explained, regression test added, CI green. Confidence 5/5.
…pendant is listed again (#22895) FlashPageWalSyncImpl.syncWal looked the recording up by object in its list. That list is rebuilt with new Wal objects when the pendant connects, on every discovery wake and after each sync pass, while the recording page keeps the Wal it was opened with. Since #22417 the relisted recording keeps its id, but the lookup by object still found nothing, so Transfer to Phone failed with "Device recording list changed; go back and try again" for a recording that was still listed. Match by id and storage, as deleteWal and the SD card sync (#22414) do, and run the transfer on the listed entry. A recording that is no longer listed still fails without asking the pendant for audio.
What changed and why
Fixes #22416
A Limitless pendant's flash backlog is listed on Offline Sync as one recording, and
FlashPageWalSyncImpl._getMissingWals()estimated its start as now minus its duration every time it listed the pendant. The list is rebuilt on connect, on every transfer-coordinator pass while the app is in the foreground (and periodic or device-connected wakes in the background), and before and after each Sync pass. So the same recording's start time moved forward with the clock, and becauseWal.idis<device>_<timerStart>, it got a new id each time. Whatever held it by id lost it: the recording's page (SyncProvider.getWalById) fell back to the copy it was opened with,deleteWalignored it, and the Offline Sync row keys changed._getMissingWals()now reuses thetimerStartof the listed recording with the same device and first page (storageOffset), so the start estimated at the first listing is kept for as long as the pendant reports the same first flash page. A transfer that stops part-way already moves the listed recording'sstorageOffsetpast the pages it saved and acknowledged, and keeps itstimerStart, so the rest of the recording keeps its id too. A backlog with a different first page still gets a fresh estimate, and a disconnect still clears the list as before.The listing's two device reads (
_getStorageStatusand the device-info read) now use the existingtestConnectionseam, as_syncWalalready does, so a unit test can drive the real listing. No production code setstestConnection.#22370 (open) changes
syncWalin the same file; the two diffs touch different lines.Product invariants affected
app/lib/services/wals/**. Only the listed recording's estimated start time and id change. What is read from the pendant, what is acknowledged, and when, are unchanged.How it was verified
origin/main(c88d8b5):flash_page_wal_sync.dart:178setstimerStartto now minusestimatedSecondson every listing, andwal.dart:269buildsidfrom it.setDevice(:808-821, called on connect fromdevice_provider.dart:1096) andrefreshWalsFromDevice(:217-228), which is called by the coordinator's discover pass (sync_provider.dart:544-548, run on every foreground pass atrecording_transfer_coordinator.dart:351-353), byWalSyncs.syncAllbefore downloading flash pages (wal_syncs.dart:332) and byFlashPageWalSyncImpl.syncAllafter each pass (:288).wal_item_detail_page.dart:140and:494(getWalById(widget.wal.id) ?? widget.wal),deleteWal(:140), andsync_page.dart:142(Dismissible(key: Key(wal.id)))._syncWalmovesstorageOffsetin place after a cancel (:567) or a partial download (:684) and keepstimerStart, so the next listing matches it.dart format --language-version=3.0 --line-length 120made no changes to the two Dart files. The changelog fragment and the failure-class definition parse as JSON.ci:fullruns the new test and the full app suite. I wrote the test to fail without the fix: with only thetimerStartline reverted, the second listing gets a different id.Tests
app/test/unit/flash_page_wal_listing_test.dart(new) drivesrefreshWalsFromDevice()against a fake pendant that reports its flash pointers:listing the same pendant backlog again keeps its recording id: lists the backlog, waits past a second boundary and lists it again: a new entry with the same id. Then the pendant reports more pages after the same first page: still the same id, with the longer duration.a transfer that stopped part-way keeps the recording id when the pendant is listed again: moves the listed recording's first page as_syncWaldoes after a stall or cancel, and the pendant drops those pages: the rest keeps the id, with the new first page and duration.UI evidence
UI-Evidence: none -- no layout change, and no simulator or device is available here. The Offline Sync rows and the recording page already show
timerStartand look the recording up byid; the test checks theid, which is built fromtimerStart.Failure class (fixes)
Failure-Class: new
Failure-class transition narrative (only when needed)
Adds
FC-relisted-identity-derived-from-clock. Violated contract: a record that is rebuilt every time its source is listed again must keep the identity it was first listed with for as long as it is the same source. Here a Limitless backlog'sWal.idtook itstimerStartfrom the clock at listing time, so every re-read renamed it. Canonical guard: derive a relisted record's identity from what the source reports, or carry forward the identity from the first listing, and test it by listing the same source twice with the clock moved on (app/test/unit/flash_page_wal_listing_test.dart). No existing class fits:FC-import-unstable-identityis the same idea for backend imports, and the classes scoped toapp/lib/services/wals/**cover drain stalls, deletes, wake cadence and durability, not listing identity. Evidence: this PR.🤖 Generated with Claude Code