mirror of
https://github.com/johannesjo/super-productivity.git
synced 2026-07-26 09:23:50 +00:00
Addresses the P1 findings from the multi-agent branch review: - setActiveContext is now guarded by a monotonic activeContextSeq: concurrent context switches that resolve out-of-order bail after each await instead of writing the previous editor doc under the new context's id. Title write timers and pendingTitleWrites are cleared on every switch so they can't mutate the next context's cache. - setContent catch path no longer silently overwrites a corrupt blob: when parsing fails we set isDocCorrupt and gate scheduleSave on it, so the empty seed shown in the editor is never persisted on top of the original (possibly recoverable) JSON. - findParentTaskIdBefore and validInsertRange now iterate doc.childCount manually instead of doc.resolve(...).index(0). Provably correct at every top-level gap; the resolve+index path was flagged by review as mis-resolving for some positions. - onAnyTaskUpdate only auto-appends a chip on a transition absent → present in taskCache (tracked via lastSeenTaskIds). Updates for existing tasks — including time-tracking ticks — no longer re-insert chips the user has intentionally removed. - Work-context header button re-registration is now replace, not skip. Iframes that re-mount (work-view embed cycling with skipCleanupOnDestroy: true) produce a new onClick closure pointing at the new Window; the bridge would previously reject the new entry as a duplicate and keep posting to the detached Window. Spec updated to assert replacement instead of dedup-skip. - Track lastWrittenTitles per task to seed a future, more robust echo-vs-remote-change discrimination in refreshTaskRef (the current 500 ms pendingTitleWrites window can still race with a concurrent remote edit, but the deeper fix needs a follow-up). |
||
|---|---|---|
| .. | ||
| scripts | ||
| src | ||
| .gitignore | ||
| package-lock.json | ||
| package.json | ||
| tsconfig.json | ||