Repository navigation
fix: keep using a cached client when the update check cannot reach GitHub - #98
Merged
Merged
Conversation
…tHub When a complete prebuilt client was cached and its periodic update check was due, `ruflet run --web` and `--desktop` failed whenever GitHub could not be reached (offline, DNS failure, 5xx or the unauthenticated rate limit): release_latest raised, ensure_prebuilt_client turned that into nil, and the run reported the client as missing although the cache was intact. The run callers now pass use_cache_if_check_fails: true, so a failed probe prints one warning and returns the cache, without marking it checked so the next run tries again. `ruflet update` keeps failing when the check cannot run. Fixes #95
This was referenced Nov 20, 2026
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.
Fixes #95
Problem
When a complete prebuilt client is cached and its periodic update check is due (6 hours by default),
ruflet run --webandruflet run --desktopcall GitHub first. If GitHub cannot be reached (offline, a DNS failure, a 5xx, or the unauthenticated rate limit),release_latestraises.ensure_prebuilt_clientturns that error intonil, so the run reports the client as missing even though the cache is still on disk:What changed
ensure_prebuilt_clienttakes a new keyword,use_cache_if_check_fails:, which defaults tofalse. Only the two run callers passtrue:detect_web_client_diranddetect_desktop_client_command.cache_readybranch prints one warning and returns the cache:Could not check for a newer client (<reason>); using the cached one.ruflet updatedoes not pass the keyword. Its error is re-raised into the existing method-level rescue, so it still exits 1 withFailed to update web client for macos. Reporting "Updated ..." from a check that never ran would be misleading.release_lateststill raises.run-main.rb--web-offlineis byte-identical).packages/ruflet/README.md: one added sentence, next to the existing six-hour note.Behavior changes
Each of these is a clear bug fix (D6). No other existing invocation's output changes:
ruflet run main.rb --webwith a complete cache, a due check and GitHub unreachable:ruflet run main.rb --desktopin the same state:ruflet update webin the same state is unchanged: exit 1, "Failed to update web client for macos". A new golden pins this.No app code and no command line change.
How verified
packages/ruflet/test/run_command_test.rb). Each stubsgithub_get_jsonto fail, so the realrelease_by_tag/release_latestchain runs.test_run_web_keeps_a_complete_cache_when_the_update_check_cannot_reach_githubtest_run_desktop_keeps_a_complete_cache_when_the_update_check_cannot_reach_github(macOS layout)test_update_still_fails_when_the_update_check_cannot_reach_githubnil) and the update test passes. With the fix, all three pass.packages/ruflet/test/compat/corpus.rb): three new entries, each with a seeded cache,RUFLET_CLIENT_UPDATE_INTERVAL=0and the harness network answering 503. They are added at the end of the run and update sections.run-main.rb--web-seeded-due-offlinerun-main.rb--desktop-seeded-due-offlineupdate-web-seeded-due-offlineruby test/compat/compat.rb --jobs 4checked 237 goldens with 0 diffs. That is all 234 existing goldens byte-identical, plus the 3 new ones.packages/ruflet/test/*_test.rbfile, one process per file, has 0 failures and 0 errors.http_proxy=http://127.0.0.1:9so every connection is refused.ruflet run main.rb --webnow prints the warning and serves the cache.RUFLET_CLIENT_AUTO_UPDATE=0, or with a check that is not due, behaves as before.