feat: cold-start fetch token-refresh outcome for diagnostics / JS#71
Closed
oferRounds wants to merge 2 commits into
Closed
feat: cold-start fetch token-refresh outcome for diagnostics / JS#71oferRounds wants to merge 2 commits into
oferRounds wants to merge 2 commits into
Conversation
- NitroFetchClient: attach Cookie from CookieManager when request has no Cookie header; persist Set-Cookie from responses (including redirects). - AutoPrefetcher: same for HttpURLConnection token refresh; persist Set-Cookie from refresh response. Helps SAML/session flows where the session cookie lives in the WebView cookie jar. Made-with: Cursor
- Android AutoPrefetcher: persist last outcome to SharedPreferences (plaintext key nitro_token_refresh_fetch_last_outcome) at each exit: success, failed_skip, failed_cache, none, not_run, error. - iOS NitroAutoPrefetcher: mirror outcome writes to UserDefaults. - JS: getFetchTokenRefreshLastOutcome(); clearTokenRefresh removes the outcome key. Depends on Android CookieManager sync PR for a clean AutoPrefetcher history. Made-with: Cursor
Collaborator
|
Hey Thanks for the PR!
|
This was referenced Apr 11, 2026
Contributor
Author
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
Compared to
main: Cold-start native fetch token refresh (before JS runs) records a plaintext last outcome readable from JavaScript, and that value is cleared when fetch token refresh config is cleared.What changes
AutoPrefetcher): Writesnitro_token_refresh_fetch_last_outcomein app prefs when the cold-start path finishes or bails:success,failed_skip,failed_cache,none,not_run, orerror.NitroAutoPrefetcher): Same key in the Nitro fetchUserDefaultssuite.getFetchTokenRefreshLastOutcome(): string;clearTokenRefresh('fetch' | 'all')also removes the outcome entry.Outcome values
success|failed_skip|failed_cache|none|not_run|error| empty string if unset or unreadable.How to verify
getFetchTokenRefreshLastOutcome()after startup; confirm it matches the native path and clears afterclearTokenRefresh('fetch').