Skip to content

fix: honour READ_ONCE_TTL=0 instead of falling back to the default - #293

Merged
isolomatov-gd merged 1 commit into
griddynamics:mainfrom
joyheroes:fix/286-read-once-ttl-zero
Aug 19, 2026
Merged

fix: honour READ_ONCE_TTL=0 instead of falling back to the default#293
isolomatov-gd merged 1 commit into
griddynamics:mainfrom
joyheroes:fix/286-read-once-ttl-zero

Conversation

@joyheroes

Copy link
Copy Markdown
Contributor

Summary

Preserve READ_ONCE_TTL=0 as a valid configured value instead of treating it as a missing value and falling back to the default TTL.

Testing

  • added regression coverage for zero TTL
  • relevant tests pass

Closes #286

@isolomatov-gd isolomatov-gd left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, @joyheroes — this matches what #286 asked for, and it was verified by execution rather than inspection.

  • The Math.max(1, …) floor is on main at read-once-shared.ts:69, so clamping 0 to 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 --noEmit clean on your head and on the merged tree.
  • The duplicate parseInt is style only, provably not a correctness issue: the function has no await/then/yield, and Node refuses a side-effecting getter on process.env, so the two calls cannot disagree.

Approved.

@isolomatov-gd
isolomatov-gd merged commit 0ded8b8 into griddynamics:main Aug 19, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ROSETTA] READ_ONCE_TTL=0 silently ignored, falls back to 20-min default

2 participants