Skip to content

fix(op-log): skip compaction while boot hydration replay is in progress (#9084) - #9568

Merged
johannesjo merged 3 commits into
super-productivity:masterfrom
AlvaroBalbin:fix/9084-op-log-compaction-racing
Aug 14, 2026
Merged

johannesjo merged 3 commits into
super-productivity:masterfrom
AlvaroBalbin:fix/9084-op-log-compaction-racing

Conversation

@AlvaroBalbin

Copy link
Copy Markdown
Contributor

This is a small, targeted change to src/app/op-log/apply/hydration-state.service.ts, .../operation-log-compaction.service.spec.ts, .../operation-log-compaction.service.ts, .../operation-log-hydrator.service.spec.ts and a few others that resolves the reported issue without touching anything unrelated. Fixes #9084.

I pushed this to my fork first and the project's own CI workflows pass on the commit.

@github-actions

github-actions Bot commented Aug 14, 2026 •

Copy link
Copy Markdown
Contributor

Preview Deployment

Status URL
Deployed https://e061e150.super-productivity-preview.pages.dev

Branch: fix/9084-op-log-compaction-racing
Commit: 1b0dad3


Deployed with Cloudflare Pages

hydrateStore() now flags hydration-in-progress at the start of every run
(super-productivity#9084), so the hand-rolled HydrationStateService stub in the retry
integration spec must provide the setter too — without it all three of
this file's boots fail with a TypeError, which is what broke the Tests
job on CI.
@johannesjo johannesjo changed the title fix(op-log): op-log: compaction racing boot hydration replay can cache fix(op-log): skip compaction while boot hydration replay is in progress (#9084) Aug 14, 2026
…lag inside try

- Correct the reachability story in every comment copy: the cold-boot
  trigger cited before (TODAY_TAG repair on loadAllData) cannot fire —
  skipDuringSyncWindow() requires isInitialSyncDoneSync(), which only
  flips after hydrateStore() resolves. The live windows are re-entrant
  hydration (PluginAPI.reInitData()) in a session past the compaction
  threshold, and the legacy-snapshot compact() in
  RemoteOpsProcessingService. Also avoid claiming the compaction counter
  is persisted across restarts — it is not (super-productivity#8336); the retrigger works
  because a skipped compaction leaves the in-memory counter over
  threshold.
- Keep one canonical explanation at the guard in _doCompact and trim the
  four other copies to short pointers (super-productivity#9140 style).
- Set the hydration-in-progress flag inside the try block so a throw
  still reaches the recovery path; the finally clears it on every exit
  either way.
@johannesjo
johannesjo merged commit 331749d into super-productivity:master Aug 14, 2026
22 checks passed
@johannesjo

Copy link
Copy Markdown
Collaborator

Thank you very much! <3

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.

op-log: compaction racing boot hydration replay can cache state missing tail-op effects (op loss)

2 participants