Repository navigation
Conversation
NickSdot
reviewed
Sep 11, 2026
Girgias
reviewed
Sep 11, 2026
iliaal
force-pushed
the
fix/session-write-truncate-84
branch
from
September 11, 2026 11:37
4ca4585 to
870a4b2
Compare
jorgsowa
reviewed
Oct 14, 2026
jorgsowa
left a comment
Contributor
There was a problem hiding this comment.
TBH the test is not very intuitive to read. May be improved. Also there is missing test case for failing partial write, but it could require more changes to the code than just this fix, so it may be left for another PR.
iliaal
force-pushed
the
fix/session-write-truncate-84
branch
from
October 15, 2026 11:45
870a4b2 to
37922e1
Compare
Member
Author
|
Leaving the partial-write test case for a follow-up. |
jorgsowa
approved these changes
Oct 15, 2026
Truncating before a shorter write discards the old session data even when the write fails without storing any bytes. Truncate only after the full write and update the cached size for subsequent writes.
iliaal
force-pushed
the
fix/session-write-truncate-84
branch
from
October 15, 2026 16:43
37922e1 to
d6b1147
Compare
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.
The files session save handler truncated the session file to zero before writing, so a short or failed write returned failure with the previous data already gone. It now writes first and truncates to the new length only after the full buffer lands.