Repository navigation
fix(history): make snapshots durable and keep history controls visible - #159
Merged
Merged
Conversation
…s by capture time Signed-off-by: Leo Stehlik <[email protected]>
Signed-off-by: Leo Stehlik <[email protected]>
Signed-off-by: Leo Stehlik <[email protected]>
Signed-off-by: Leo Stehlik <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
A browser edit could save successfully but never reach page history if an ancillary queue failed after the page transaction. Title-only changes were not scheduled, and the history worker ignored them. History also sorted random agent IDs as if they were chronological. Separately, fixed-height history panels hid Restore/Cancel/diff controls on short desktop screens, and an open history dialog never refreshed its list.
This PR addresses persistence, presentation, and change navigation:
Commit pending snapshot work with body/title/icon edits in PostgreSQL. A bounded worker coalesces edits using the existing one-/five-minute windows, captures and acknowledges snapshots atomically, retains failures with backoff, and transfers legacy BullMQ history jobs. Notification/indexing/watcher failures cannot discard the pending snapshot.
Order versions by capture timestamp and ID. Cursor anchors resolve their timestamps in SQL, preserving microseconds and compatibility with existing ID cursors. Agent snapshots also retain icon/cover metadata.
Fit the dialog to the viewport, keep controls outside scrolling panels, refresh while open, and show pending/retrying snapshot status. Indicate title/metadata changes and formatting-only differences that text highlighting cannot show.
Navigate using scroll-viewport coordinates, so changes inside positioned table cells no longer jump to the top. A synthetic three-location page reproduced the original failure; the fix also covers manual scrolling and wraparound.
The page-history user guide explains the one-/five-minute grouping windows, pending/retry notices, automatic refresh, and local timestamps shown in 12-hour format, change-arrow behaviour, and restoring a version. It is linked from the README and operations notes.
Data and deployment
The additive migration creates one pending-work table and two indexes. It does not rewrite/delete existing pages, versions, audit records, or uploads. Snapshot grouping remains intentional; this does not create a version for every keystroke or reconstruct previously missing versions. Deployment/recovery guidance is in
docs/page-history.md.The reported page-specific loading failure remains deferred in #158. This PR does not claim to diagnose or fix that separate report.
Validation
Deployed at commit
c38da15(including the navigation fix and user guide) to the maintainer’s test instance and accepted after live testing. Merged intomasterafter all five CI checks passed. Startup is healthy, the additive migration applied, existing content hashes matched before/after deployment, and the database/storage were retained.DCO sign-off
All commits include a
Signed-off-byline matching the contributor identity. Implemented from WrenLore code and reproduced behaviour; no post-fork upstream or proprietary code was used.