Add request timeout handling and reduce CI test retries#453
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds timeout handling to AJAX fetches used by Formeo resource loading and reduces CI Playwright retries to speed up feedback.
Changes:
- Added a default
AJAX_TIMEOUT_MSand optionaltimeoutMsparameter toajax(). - Uses
AbortSignal.timeout()when available and resolves error handling throughonError(). - Reduced CI Playwright retries from 2 to 1.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/lib/js/common/loaders.js |
Adds configurable fetch timeout support and resolves fetch errors through the error callback. |
playwright.config.js |
Lowers CI retry count for Playwright tests. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ries - Add 10s timeout via AbortSignal to ajax() in loaders so a slow or blocked CDN cannot stall editor init for the full per-test timeout. - Resolve the ajax promise from the catch handler so failed fallback fetches no longer leave callers waiting forever. - Reduce CI retries from 2 to 1 to cap the cost of flaky tests.
36df3b7 to
40918bc
Compare
Collaborator
Author
|
🎉 This PR is included in version 5.1.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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
This PR improves the robustness of AJAX requests by adding configurable timeout support and reduces unnecessary test retries in CI environments.
Key Changes
AJAX_TIMEOUT_MSconstant (10 seconds default) and atimeoutMsparameter to theajax()function. Uses the nativeAbortSignal.timeout()API when available for automatic request cancellation..catch()to resolve withonError()result instead of rejecting, ensuring consistent error handling behavior.Implementation Details
AbortSignal.timeout()is not available (older environments), the signal is undefined and fetch proceeds without timeout.https://claude.ai/code/session_012w1wEVswQvBsQPEeaXwZvW