Skip to content

Keep persistence alive past a single fault - #24075

Merged
IDCs merged 1 commit into
release/v2.6from
fix/laz-1007
Sep 2, 2026
Merged

Keep persistence alive past a single fault#24075
IDCs merged 1 commit into
release/v2.6from
fix/laz-1007

Conversation

@IDCs

@IDCs IDCs commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

One fault in the diff pipeline cost the rest of the session, silently: a diff past the engine's argument-spread limit threw out of computeStateDiff, the throw escaped dispatch and froze previousState so every later diff grew from the same stale snapshot, and a send failure left the flush timer handle set so no flush was ever scheduled again.

Diff operations are now appended without spread, a diff-computation fault is caught and logged with previousState held so the changes ride the next diff, and a hive's queue is only cleared once its send succeeded.

fixes LAZ-1007

@IDCs IDCs self-assigned this Sep 1, 2026
@IDCs
IDCs requested a review from a team as a code owner September 1, 2026 12:24
Comment thread src/renderer/src/store/persistDiffMiddleware.ts Outdated
Comment thread src/renderer/src/store/stateDiff.ts Outdated
Comment on lines +19 to +28
/**
* Append without spread: `push(...items)` passes every element as an argument and throws past
* the engine's argument limit (~125k); one subtree's diff can exceed that.
*/
function appendOperations(target: DiffOperation[], items: DiffOperation[]): void {
for (const item of items) {
target.push(item);
}
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't really, it can be an anonymous function too. As long as we don't spread the items in a push.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Opted for a recursive accumulator instead - we already use the same shape for state flattening which works quite well.

One fault in the diff pipeline cost the rest of the session, silently: a diff
past the engine's argument-spread limit threw out of computeStateDiff, the
throw escaped dispatch and froze previousState so every later diff grew from
the same stale snapshot, and a send failure left the flush timer handle set so
no flush was ever scheduled again.

Diff operations are now appended without spread, a diff-computation fault is
caught and logged with previousState held so the changes ride the next diff,
and a hive's queue is only cleared once its send succeeded.

fixes LAZ-1007
@IDCs
IDCs merged commit 1207571 into release/v2.6 Sep 2, 2026
7 checks passed
@IDCs
IDCs deleted the fix/laz-1007 branch September 2, 2026 08:36
pull Bot pushed a commit to A-Archives-and-Forks/Vortex that referenced this pull request Sep 2, 2026
Keep persistence alive past a single fault
joshedney pushed a commit that referenced this pull request Sep 2, 2026
Keep persistence alive past a single fault
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants