fix: honour READ_ONCE_TTL=0 instead of falling back to the default - #293
Merged
isolomatov-gd merged 1 commit intoAug 19, 2026
Merged
Conversation
isolomatov-gd
approved these changes
Aug 19, 2026
isolomatov-gd
left a comment
Contributor
There was a problem hiding this comment.
Thank you, @joyheroes — this matches what #286 asked for, and it was verified by execution rather than inspection.
- The
Math.max(1, …)floor is onmainatread-once-shared.ts:69, so clamping0to 1s is pre-existing behaviour, not something this PR introduces. Your fix does exactly what the issue body prescribes: replace||with an explicit NaN check. - 62-input differential matrix run against both trees — including unicode zeros, BOM, NBSP, NUL, CRLF,
"0x0","0e5","5abc","1e3","Infinity", 600 zeros, and a shell-injection string. The set of inputs whose behaviour changes is exactly{x : parseInt(x,10) === 0}. Nothing else moved. - The NaN branch is right: unset,
""," ","abc","NaN","null"all still resolve to the 20-minute default on both trees. - Three independent mutations each got caught with distinct signatures — reverting the fix, dropping the floor, and changing the default. The tests are not tautological.
- 1142 → 1144 tests, zero regressions;
tsc --noEmitclean on your head and on the merged tree. - The duplicate
parseIntis style only, provably not a correctness issue: the function has noawait/then/yield, and Node refuses a side-effecting getter onprocess.env, so the two calls cannot disagree.
Approved.
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
Preserve
READ_ONCE_TTL=0as a valid configured value instead of treating it as a missing value and falling back to the default TTL.Testing
Closes #286