Skip to content

Preserve offline task edits through rejection and reduce 10k editor work - #686

Merged
callumalpass merged 1 commit into
mainfrom
sprint-w9-tn-offline-safety-perf
Nov 28, 2026
Merged

callumalpass merged 1 commit into
mainfrom
sprint-w9-tn-offline-safety-perf

Conversation

@callumalpass

@callumalpass callumalpass commented Nov 28, 2026 •

Copy link
Copy Markdown
Owner

Offline editing

A title save could send an old body back after another client had edited it. Clearing a property could disappear from the recovery copy because JSON omits undefined values. The editor now sends explicit changes, records clears as null and merges individual custom properties into the latest task. It retains the device copy while receipts are pending or rejected. “Keep my edit” checks the reviewed revision and preserves unrelated peer changes.

Two unit regressions fail against 25c1674c. The Chromium SDK fixture also reproduces a lost estimate clear on that baseline. It reloads the app over a retained MemoryReplica and write ledger, simulates the peer edit and rejection, reloads again during review, then checks the final title, body, estimate and peer priority.

Collection performance

The detail editor caches its navigation position. The filter preview depends on the query fields. Bulk selection keeps a reading-order index and reuses its selected rows and tag calculations.

Run rpnpm bench:editor-interactions for three 10,000-task React/jsdom samples. Ten changes to the last task’s title previously visited 100,000 navigation IDs and now visit zero. Five view-name changes previously evaluated the filter five times and now evaluate it zero times. The benchmark also exercises opening and saving a task, applying tag, context, project and status filters, and selecting and updating 32 tasks.

Median milliseconds across three shared-builder runs on each revision. The baseline is 25c1674c.

Operation Baseline PR
Detail open / ten changes / blur-save 93 / 61 / 79 95 / 57 / 76
Open filter editor 153 155
Apply tag / context / project / status filter 126 / 121 / 119 / 120 124 / 121 / 120 / 120
Rename filtered view, five changes 573 25
Register 10k rows 3.59 1.88
Select 32 / apply priority to 32 83.65 / 10.78 0.17 / 7.12

Validation

  • Full unit suite passed with 2,368 tests passed and nine skipped. Production build, typecheck and lint passed.
  • Chromium passed the recovery scenario three consecutive times on the development server. All seven tests in the offline-edit and cloud-connection suites passed on the packaged /tasknotes-app/ preview.
  • The SDK fixture models an offline device by holding confirmations while its local replica remains available. The CLI edit is simulated by the replica. Tab-only pairings retain their existing tab-lifetime draft policy.

@callumalpass
callumalpass merged commit b156537 into main Nov 28, 2026
8 checks passed
@callumalpass
callumalpass deleted the sprint-w9-tn-offline-safety-perf branch November 28, 2026 10:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant