Skip to content

Fix reduced timeouts being used for HTTP requests when a proxy URL is configured#3188

Merged
rickvdl merged 2 commits into
mainfrom
rickvdl/fix-http-request-timeout-when-using-proxy-url
Mar 9, 2026
Merged

Fix reduced timeouts being used for HTTP requests when a proxy URL is configured#3188
rickvdl merged 2 commits into
mainfrom
rickvdl/fix-http-request-timeout-when-using-proxy-url

Conversation

@rickvdl

@rickvdl rickvdl commented Mar 6, 2026

Copy link
Copy Markdown
Member

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

  • Added getTimeoutForRequest returns DEFAULT_TIMEOUT_MS for fallback-supporting endpoint when proxy URL is set
  • Added getTimeoutForRequest returns DEFAULT_TIMEOUT_MS after timeout when proxy URL is set
  • All 17 existing HTTPTimeoutManager tests pass

@rickvdl rickvdl added the pr:fix A bug fix label Mar 6, 2026
@rickvdl rickvdl marked this pull request as ready for review March 6, 2026 15:50
@rickvdl rickvdl requested a review from a team as a code owner March 6, 2026 15:50
rickvdl added 2 commits March 6, 2026 16:51
…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.
… + hasProxyURL

Move the fallback availability check (supportsFallbackBaseURLs && no proxy)
to the caller, simplifying the timeout manager interface.
@rickvdl rickvdl force-pushed the rickvdl/fix-http-request-timeout-when-using-proxy-url branch from dbf1455 to cd352cd Compare March 6, 2026 15:51

@tonidero tonidero 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 for the quick fix! 🙏

@codecov

codecov Bot commented Mar 6, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 75.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 79.32%. Comparing base (a537ae9) to head (cd352cd).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
...tlin/com/revenuecat/purchases/common/HTTPClient.kt 66.66% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3188      +/-   ##
==========================================
- Coverage   79.32%   79.32%   -0.01%     
==========================================
  Files         351      351              
  Lines       14131    14132       +1     
  Branches     1928     1928              
==========================================
  Hits        11210    11210              
  Misses       2121     2121              
- Partials      800      801       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@rickvdl rickvdl added this pull request to the merge queue Mar 9, 2026
Merged via the queue into main with commit 2353213 Mar 9, 2026
29 checks passed
@rickvdl rickvdl deleted the rickvdl/fix-http-request-timeout-when-using-proxy-url branch March 9, 2026 08:04
@tonidero tonidero mentioned this pull request Mar 9, 2026
tonidero added a commit that referenced this pull request Mar 9, 2026
### Description
Fix for integration tests. One of them broke with the changes in #3188 

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Test-only change that updates a mocked `AppConfig` to match a newer
interface; no production logic is modified.
> 
> **Overview**
> Fixes broken Android integration tests by updating
`PurchasesIntegrationTest`'s mocked `AppConfig` to provide
`fallbackBaseURLs` (set to an empty list) when constructing the
`HTTPClient`.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
06e4f9f. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
This was referenced Mar 11, 2026
github-merge-queue Bot pushed a commit that referenced this pull request Mar 12, 2026
**This is an automatic release.**

## RevenueCat SDK
### ✨ New Features
* [EXPERIMENTAL]: Beta Galaxy Store Support (#2903) via Will Taylor
(@fire-at-will)
### 🐞 Bugfixes
* Skip installation on GCP CLI in run-firebase-test (#3218) via Will
Taylor (@fire-at-will)
* Fix reduced timeouts being used for HTTP requests when a proxy URL is
configured (#3188) via Rick (@rickvdl)

## RevenueCatUI SDK
### 🐞 Bugfixes
* Fix missing ripple effect in View-based paywall wrappers (#3206) via
Toni Rico (@tonidero)
### Paywallv2
#### ✨ New Features
* Rules v0 Integration branch (#3117) via Cesar de la Vega (@vegaro)

### 🔄 Other Changes
* [Galaxy]: Add promotionEligibilities comment (#3214) via Will Taylor
(@fire-at-will)
* [EXTERNAL] Migrate deprecated buildDir to layout API (#3202)
contributed by @AlexanderTalledo (#3212) via Toni Rico (@tonidero)
* Remove automatic Claude code review workflow (#3211) via Cesar de la
Vega (@vegaro)
* Remove unused convention plugin (#3195) via Toni Rico (@tonidero)
* [EXTERNAL] Integrate convention plugins into Version Catalogs (#3181)
contributed by @AlexanderTalledo (#3194) via Toni Rico (@tonidero)
* [EXTERNAL] Migrate androidx cardview dependency to version catalogs
(#3192) contributed by @AlenxanderTalledo (#3193) via Toni Rico
(@tonidero)
* Improve AdMob adapter test coverage (#3204) via Pol Miro (@polmiro)
* Bump fastlane-plugin-revenuecat_internal from `f5c099b` to `e146447`
(#3197) via dependabot[bot] (@dependabot[bot])
* Fix integration tests (#3196) via Toni Rico (@tonidero)

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Low risk release bookkeeping: version strings and deployment paths are
updated from `9.24.0-SNAPSHOT` to `9.24.0`, plus changelog/docs refresh.
Main risk is accidental publishing/docs deployment to the wrong
versioned location.
> 
> **Overview**
> Cuts the `9.24.0` release by updating all version references from
`9.24.0-SNAPSHOT` to `9.24.0` (root `.version`, `gradle.properties`, and
`Config.frameworkVersion`), and aligning sample/test app version
catalogs to consume the released artifact.
> 
> Updates documentation publishing to point at the `9.24.0` directory
(CircleCI S3 sync and `docs/index.html` redirect) and refreshes
`CHANGELOG.latest.md`/`CHANGELOG.md` with the `9.24.0` release notes.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
8e6d567. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr:fix A bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants