Repository navigation
Fix the restored-wording cache on Windows - #95
Merged
Merged
Conversation
The helper wrote the restored protocol.json with write_text, which on Windows turns \n into \r\n, while it recorded the sha256 of the \n text. The cached copy then never matched its record: every check restored again, and the app's run would refuse the copy. Write the exact bytes that are hashed (status.json too), and test that the cached file's sha256 is its recorded one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…h the platform separator Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t names), in the test and the pin lookup Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Main has been red on Windows since #94 (run 42820806358). In
test_original_text.py:137, the second fill was not answered from the cache.Root cause.
hs_original_text.pywrote the restoredprotocol.jsonwithPath.write_text, which turns\ninto\r\non Windows. But it recorded the sha256 of the\ntext, so the cached file never matched its own record. This affected more than the test:restoredProtocolText, which checks the file's sha256) would refuse the cached copy on Windows.Fix. Write the exact bytes that are hashed, using
write_bytes.status.jsonis written the same way. The test now also checks that the cached file's sha256 is the recorded one and that the file contains no\r\n.Only this fix is in this PR. The review follow-ups come in a separate PR on top of it.
🤖 Generated with Claude Code