feat: add targeted session logging to diagnose content-loss#147
Merged
Conversation
Track conn.connectedAt on setup, log last-connection-close with duration and unsaved state, log successful saves to da-admin, set ydoc.isDirty on updates, clear it after a successful debounced save, and log when a concurrent-save guard skips a save. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Use the existing hasClientChanged flag (from #142) to track unsaved state at last-connection-close, resetting it to false after each successful da-admin save. Removes the redundant isDirty flag. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
bosschaert
approved these changes
May 13, 2026
adobe-bot
pushed a commit
that referenced
this pull request
May 13, 2026
# [1.3.0](v1.2.7...v1.3.0) (2026-05-13) ### Features * add targeted session logging to diagnose content-loss ([#147](#147)) ([f96ce19](f96ce19))
Collaborator
|
🎉 This PR is included in version 1.3.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
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.
Summary
[docroom] Last connection closed <url> duration: <N>ms unsaved: true|false[docroom] Saved to da-admin <url> <N>bsavingguard fires):[docroom] Skip save: concurrent save in progress <url>hasClientChangedtofalseafter each successful save, so theunsavedflag at close time reflects the state since the last save — not the entire session lifetimehasClientChanged(introduced in fix: guard persistence.put against empty-stub overwrites (COR-31) #142) rather than adding a new flagThese logs directly address the gap identified in issue #145: session durations were not visible in Coralogix worker traces, making it impossible to correlate session cancellations with missed saves.
Test plan
npm test— 103 tests pass, 100% coveragenpm run lint— 0 errorsconn.connectedAtset on connection,closeConnlogs duration +unsaved: false/true,persistence.updatelogs save success, debounced save logs concurrent-skip🤖 Generated with Claude Code