fix(tui/update): ignore cached upstream upgrade metadata (#376)#385
Merged
fix(tui/update): ignore cached upstream upgrade metadata (#376)#385
Conversation
- add optional `current_date` field to `EnvironmentContext` so turn context carries ISO dates - serialize `<current_date>` tags and extend comparisons/tests to tolerate deterministic values - cover default date formatting with new unit tests
- reject cached version.json written by the upstream repo so we don't keep prompting for 0.50.0 - stamp new cache entries with the just-every/code origin to avoid future mixups - add regression tests covering legacy and current cache formats
zemaj
commented
Nov 6, 2025
Author
zemaj
left a comment
There was a problem hiding this comment.
Summary:
- Reject legacy
openai/codexcache entries and persistrelease_repo: just-every/codeso stale metadata no longer triggers repeated update prompts. - Added serialization + load tests to prove stale caches are ignored, fresh caches load, and
release_repois written back out.
Tests:
cargo test -p code-tui read_version_info_rejects_legacy_repo_cache -- --nocapturecargo test -p code-tui read_version_info_accepts_current_repo_cache -- --nocapturecargo test -p code-tui serialized_version_info_includes_release_repo -- --nocapture./build-fast.sh
Risks:
- End-to-end fetch path still depends on live GitHub; consider adding integration coverage or retries if API quota issues surface.
zemaj
commented
Nov 6, 2025
Author
zemaj
left a comment
There was a problem hiding this comment.
Summary:
- Add TTL-aware caching with clock-skew tolerance, dedupe concurrent update checks via a global async mutex, and switch to atomic temp-file writes so
version.jsonnever corrupts and stale legacy caches are ignored. - Extend
updates.rswith async tests that cover stale refetches, fresh-cache short-circuiting, concurrent dedup, malformed JSON recovery, and path/permission edge cases. - Confirm background callers still succeed and documented the new behavior/regressions in
reports/pr_385_review.md.
Validation:
cargo test -p code-tui --lib updates::./build-fast.sh
Risks / Follow-ups:
- Refresh still depends on live GitHub responses; consider introducing retries or a mockable client for hermetic testing.
- UI snapshot coverage for update toast dedupe is still pending; future PR may add VT100 assertions.
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
version.jsonfiles written by the upstreamopenai/codexrelease checker as stale so the TUI stops advertising 0.50.0just-every/code) into the cache so future reads can distinguish our fork from upstream dataTesting
Fixes #376.