Fix reduced timeouts being used for HTTP requests when a proxy URL is configured#6416
Merged
rickvdl merged 2 commits intoMar 9, 2026
Merged
Conversation
3 tasks
…RL is set When a proxy URL is configured, fallback URLs are disabled. However, the timeout manager still applied the aggressive 5s/2s timeouts meant for endpoints with fallback support. This caused proxy requests to time out with no fallback recovery path, making the proxy unusable for slow connections.
Move the fallback availability check (supportsFallbackURLs && no proxy) to the caller, simplifying the timeout manager interface.
bfd6b9c to
ddf792d
Compare
github-merge-queue Bot
pushed a commit
to RevenueCat/purchases-android
that referenced
this pull request
Mar 9, 2026
… configured (#3188) ## Summary - When a proxy URL is configured, fallback URLs are disabled (`AppConfig.fallbackBaseURLs` is empty). However, the timeout manager still applied the aggressive 5s/2s timeouts meant for endpoints with fallback support. - This caused proxy requests to time out with no fallback recovery path, making the proxy unusable for slow connections. - Added `hasProxyURL` parameter to `HTTPTimeoutManager.getTimeoutForRequest()` so it uses the default timeout when a proxy is active. **Related PR:** RevenueCat/purchases-ios#6416 ## Test plan - [x] Added `getTimeoutForRequest returns DEFAULT_TIMEOUT_MS for fallback-supporting endpoint when proxy URL is set` - [x] Added `getTimeoutForRequest returns DEFAULT_TIMEOUT_MS after timeout when proxy URL is set` - [x] All 17 existing HTTPTimeoutManager tests pass
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
hasProxyURLparameter to the timeout manager so it uses the default timeout when a proxy is active.Test plan
testUsesDefaultTimeoutForFallbackSupportingEndpointWhenProxyURLIsSet— verifies default timeout is used for fallback-supporting endpoints when proxy is settestDoesNotUseReducedTimeoutAfterTimeoutWhenProxyURLIsSet— verifies reduced timeout is not applied after a prior timeout when proxy is setNote
Medium Risk
Touches core HTTP request timeout selection logic; incorrect conditions could change timeout behavior and affect request reliability, though the behavior change is scoped to when
SystemInfo.proxyURLis set.Overview
Prevents the dynamic timeout manager from applying aggressive (5s/2s) timeouts when a proxy URL is configured and fallback URLs are therefore unavailable.
This updates the timeout manager API to take
fallbackAvailable(instead of apath) and wiresHTTPClientto passsupportsFallbackURLs && SystemInfo.proxyURL == nil, plus adds unit coverage ensuring proxy-based requests use the default timeout even after prior main-backend timeouts.Written by Cursor Bugbot for commit ddf792d. This will update automatically on new commits. Configure here.