-
Notifications
You must be signed in to change notification settings - Fork 435
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add turbo:fetch-request-error event on frame and form network errors (#…
…640) * Add turbo:fetch-error event on frame and form network errors closes #462 This PR adds a new event called `turbo:fetch-error` that dispatches when a form or frame fetch request errors. This event will let developers respond appropriately when a fetch request fails due network errors (such as on flaky wifi). At the moment, if a frame navigation fetch request fails due to a network error an error is thrown so https://github.com/hotwired/turbo/blob/2d5cdda4c030658da21965cb20d2885ca7c3e127/src/http/fetch_request.ts#L107 never runs and therefore the `turbo:before-fetch-response` event is not dispatched. * Update src/core/frames/frame_controller.ts Co-authored-by: Keith Cirkel <keithamus@users.noreply.github.com> * Update src/core/drive/form_submission.ts Co-authored-by: Keith Cirkel <keithamus@users.noreply.github.com> * Add spec * Get browser name right * Fetch project name properly * Use page.context() * remove timeout on offline * Use first page to reduce go to calls * Use tabs again since behavior is different when using turbo-action * use broader event assertion * Update event name and export type * add new event to test helper * Limit recursion in the test helper * skip the details obj instead of limiting recursion Co-authored-by: Keith Cirkel <keithamus@users.noreply.github.com>
- Loading branch information
Showing
7 changed files
with
22 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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