-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix web FetchRequest does not respect disableConnectivityCheck
client option
#1925
Conversation
Warning Rate limit exceeded@VeskeR has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 15 minutes and 51 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (2)
WalkthroughThe changes in this pull request modify the Changes
Possibly related PRs
Suggested reviewers
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
🧹 Outside diff range and nitpick comments (1)
test/browser/connection.test.js (1)
458-458
: Clarify the comment for better readabilityThe comment could be rephrased to more explicitly explain the purpose of these tests and how they differ from existing ones.
Suggested change:
- // this is identical to disable_connectivity_check test in connectivity, but here we specifically test browser supported request implementations + // Similar to the 'disable_connectivity_check' test in 'connectivity', but specifically testing browser-supported request implementations (XHR and Fetch)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (2)
src/platform/web/lib/http/http.ts
(1 hunks)test/browser/connection.test.js
(2 hunks)
🔇 Additional comments (3)
src/platform/web/lib/http/http.ts (2)
121-124
: LGTM: Proper implementation of disableConnectivityCheck option
The implementation correctly respects the disableConnectivityCheck
client option by immediately returning true when enabled, consistent with the XHR implementation.
120-138
: Verify test coverage for connectivity checks
Let's ensure that the test suite adequately covers both XHR and Fetch implementations, particularly for custom connectivity check URLs.
✅ Verification successful
Let me gather more information about the test implementations to ensure proper coverage.
Let me check the actual test cases for both success and failure scenarios to ensure complete coverage.
Test coverage for connectivity checks is comprehensive
The test suite adequately covers all aspects of the connectivity check implementation:
- Tests for both success and failure scenarios with custom URLs
- Coverage for
disableConnectivityCheck
option - Specific tests for both XHR and Fetch implementations
- Tests for connectivity check with different URL configurations
The changes in the connectivity check implementation are well-supported by existing tests.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Search for connectivity check related tests
echo "Searching for connectivity check related tests..."
rg -l "connectivityCheck|checkConnectivity" test/
# Search for custom URL configurations in tests
echo "Searching for custom connectivity URL configurations in tests..."
rg "connectivityCheckUrl" test/
Length of output: 1319
Script:
#!/bin/bash
# Check the connectivity test implementations
echo "Checking connectivity.test.js implementation:"
rg -A 10 "describe.*connectivity" test/realtime/connectivity.test.js
# Check transport test implementations
echo "Checking transport test implementations:"
rg -A 10 "describe.*connectivity" test/realtime/transports.test.js
# Check connection test implementations
echo "Checking connection test implementations:"
rg -A 10 "describe.*connectivity" test/browser/connection.test.js
# Look for disableConnectivityCheck usage in tests
echo "Checking disableConnectivityCheck usage:"
rg "disableConnectivityCheck" test/
Length of output: 2086
Script:
#!/bin/bash
# Check the specific test cases in connectivity tests
echo "Checking connectivity test cases:"
rg -B 2 -A 10 "it\(.*connectivity" test/realtime/connectivity.test.js
# Check the specific test cases in connection tests
echo "Checking connection test cases:"
rg -B 2 -A 10 "it\(.*connectivity" test/browser/connection.test.js
# Check for any XHR specific connectivity tests
echo "Checking XHR specific tests:"
rg -B 2 -A 10 "XHR.*connectivity|xhr.*connectivity" test/
Length of output: 2430
test/browser/connection.test.js (1)
3-3
: Dependency Update: Added 'Ably' module to test dependencies
Including 'Ably'
in the module dependencies ensures that the tests have access to Ably.Rest.Platform.Config
, which is necessary for configuring and manipulating platform-specific settings in the new test scenarios.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
f4acc4a
to
5cdeddc
Compare
See internal slack thread for more context.
Summary by CodeRabbit
New Features
disableConnectivityCheck
option is enabled.Bug Fixes
Tests