Skip to content
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

Show timeout errors on the frontend #2838

Merged
merged 11 commits into from
Oct 2, 2023
Merged

Conversation

obulat
Copy link
Contributor

@obulat obulat commented Aug 16, 2023

Fixes

Fixes #632 by @sarayourfriend

Description

This PR updates the FetchState to always use the FetchingError instead of NuxtError|string|FetchingError for the error object.
FetchingError interface provides more information about the error, including the response status code, the string code of the error from axios, the kind of request (single result, search, provider or the related media), and additional details such as the item id.

This interface makes it easier to show the timeout error pages on SERVER_TIMEOUT or ECONNABORTED errors.

FetchState was made a generic to allow the use of string and NuxtError for the fetchingError value. This PR removes this to make fetchState simpler.

Testing Instructions

To simulate the server timeout, lower the default timeout to 30:

const DEFAULT_REQUEST_TIMEOUT = 30000

Now, you should see the timeout error page any time you search for something. You should also see the same page if you refresh this search page (so, the page will be server-rendered now).

To see the no results error page, search for something like "querywithnoresults". It should work for all search types, both on CSR and SSR, and should not try to reload the page on SSR.

Checklist

  • My pull request has a descriptive title (not a vague title likeUpdate index.md).
  • My pull request targets the default branch of the repository (main) or a parent feature branch.
  • My commit messages follow best practices.
  • My code follows the established code style of the repository.
  • I added or updated tests for the changes I made (if applicable).
  • I added or updated documentation (if applicable).
  • I tried running the project locally and verified that there are no visible errors.
  • I ran the DAG documentation generator (if applicable).

Developer Certificate of Origin

Developer Certificate of Origin
Developer Certificate of Origin
Version 1.1

Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
1 Letterman Drive
Suite D4700
San Francisco, CA, 94129

Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.


Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
    have the right to submit it under the open source license
    indicated in the file; or

(b) The contribution is based upon previous work that, to the best
    of my knowledge, is covered under an appropriate open source
    license and I have the right under that license to submit that
    work with modifications, whether created in whole or in part
    by me, under the same open source license (unless I am
    permitted to submit under a different license), as indicated
    in the file; or

(c) The contribution was provided directly to me by some other
    person who certified (a), (b) or (c) and I have not modified
    it.

(d) I understand and agree that this project and the contribution
    are public and that a record of the contribution (including all
    personal information I submit with it, including my sign-off) is
    maintained indefinitely and may be redistributed consistent with
    this project or the open source license(s) involved.

@github-actions github-actions bot added the 🧱 stack: frontend Related to the Nuxt frontend label Aug 16, 2023
@openverse-bot openverse-bot added 🟧 priority: high Stalls work on the project or its dependents ✨ goal: improvement Improvement to an existing user-facing feature 🕹 aspect: interface Concerns end-users' experience with the software labels Aug 16, 2023
@@ -117,7 +117,7 @@ export default defineComponent({
},
hasNoResults: {
type: Boolean,
required: true,
default: true,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This prop will be removed in #2811, so I set a default value for it to avoid computing it.

@@ -14,9 +14,6 @@
:related-to="relatedTo"
/>
</ol>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When there is an error, VImageGrid is not displayed at all, so this was unused.

@@ -64,7 +61,9 @@ export default defineComponent({
required: true,
},
fetchState: {
type: Object as PropType<FetchState<NuxtError>>,
type: Object as PropType<
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VImageGrid is used for search results that are updated in this PR, but also for the related images, which will be updated later, so we use both FetchState types here.

@github-actions
Copy link

github-actions bot commented Aug 16, 2023

Size Change: +35.5 kB (+4%)

Total Size: 927 kB

Filename Size Change
./frontend/.nuxt/dist/client/app.js 123 kB +150 B (0%)
./frontend/.nuxt/dist/client/app.modern.js 114 kB +151 B (0%)
./frontend/.nuxt/dist/client/commons/app.js 90 kB +15 B (0%)
./frontend/.nuxt/dist/client/commons/app.modern.js 81 kB +25 B (0%)
./frontend/.nuxt/dist/client/commons/components/v-error-section/components/v-external-search-form/components/v-external-source-li/98a81936.js 0 B -5.18 kB (removed) 🏆
./frontend/.nuxt/dist/client/commons/components/v-error-section/components/v-external-search-form/components/v-external-source-li/98a81936.modern.js 0 B -5.62 kB (removed) 🏆
./frontend/.nuxt/dist/client/components/v-error-section.js 5.2 kB -10 B (0%)
./frontend/.nuxt/dist/client/components/v-image-grid.js 4.47 kB -45 B (-1%)
./frontend/.nuxt/dist/client/components/v-image-grid.modern.js 4.35 kB -49 B (-1%)
./frontend/.nuxt/dist/client/components/v-media-details.js 5.64 kB +3.02 kB (+115%) 🆘
./frontend/.nuxt/dist/client/components/v-media-details.modern.js 5.49 kB +2.89 kB (+111%) 🆘
./frontend/.nuxt/dist/client/components/v-media-details/pages/image/_id/index.js 0 B -3.79 kB (removed) 🏆
./frontend/.nuxt/dist/client/components/v-media-details/pages/image/_id/index.modern.js 0 B -3.67 kB (removed) 🏆
./frontend/.nuxt/dist/client/pages/audio/_id/index.js 17.3 kB +6.53 kB (+61%) 🆘
./frontend/.nuxt/dist/client/pages/audio/_id/index.modern.js 16.2 kB +5.75 kB (+55%) 🆘
./frontend/.nuxt/dist/client/pages/image/_id/index.js 15.6 kB +5.88 kB (+61%) 🆘
./frontend/.nuxt/dist/client/pages/image/_id/index.modern.js 14.6 kB +5.12 kB (+54%) 🆘
./frontend/.nuxt/dist/client/pages/search.js 5.78 kB +1 kB (+21%) 🚨
./frontend/.nuxt/dist/client/pages/search.modern.js 8.13 kB +3.57 kB (+78%) 🆘
./frontend/.nuxt/dist/client/vendors/app.modern.js 68.1 kB +114 B (0%)
./frontend/.nuxt/dist/client/commons/components/v-error-section/components/v-external-search-form/components/v-external-source-li/e4094511.js 5.18 kB +5.18 kB (new file) 🆕
./frontend/.nuxt/dist/client/commons/components/v-error-section/components/v-external-search-form/components/v-external-source-li/e4094511.modern.js 5.62 kB +5.62 kB (new file) 🆕
./frontend/.nuxt/dist/client/components/v-related-audio/pages/search/audio.js 4.49 kB +4.49 kB (new file) 🆕
./frontend/.nuxt/dist/client/components/v-related-audio/pages/search/audio.modern.js 4.38 kB +4.38 kB (new file) 🆕
ℹ️ View Unchanged
Filename Size Change
./frontend/.nuxt/dist/client/239.js 343 B 0 B
./frontend/.nuxt/dist/client/239.modern.js 346 B 0 B
./frontend/.nuxt/dist/client/240.js 1.85 kB 0 B
./frontend/.nuxt/dist/client/components/loading-icon.js 730 B +1 B (0%)
./frontend/.nuxt/dist/client/components/loading-icon.modern.js 735 B +1 B (0%)
./frontend/.nuxt/dist/client/components/table-sort-icon.js 515 B 0 B
./frontend/.nuxt/dist/client/components/table-sort-icon.modern.js 518 B -1 B (0%)
./frontend/.nuxt/dist/client/components/v-all-results-grid.js 6.78 kB +4 B (0%)
./frontend/.nuxt/dist/client/components/v-all-results-grid.modern.js 6.61 kB +1 B (0%)
./frontend/.nuxt/dist/client/components/v-audio-collection.js 4.5 kB -7 B (0%)
./frontend/.nuxt/dist/client/components/v-audio-collection.modern.js 4.38 kB -2 B (0%)
./frontend/.nuxt/dist/client/components/v-audio-control.js 1.51 kB +1 B (0%)
./frontend/.nuxt/dist/client/components/v-audio-control.modern.js 1.51 kB +2 B (0%)
./frontend/.nuxt/dist/client/components/v-audio-list.js 1.44 kB -3 B (0%)
./frontend/.nuxt/dist/client/components/v-audio-list.modern.js 1.42 kB -1 B (0%)
./frontend/.nuxt/dist/client/components/v-audio-result.js 1.11 kB -2 B (0%)
./frontend/.nuxt/dist/client/components/v-audio-result.modern.js 1.1 kB -1 B (0%)
./frontend/.nuxt/dist/client/components/v-audio-track-skeleton.js 957 B 0 B
./frontend/.nuxt/dist/client/components/v-audio-track-skeleton.modern.js 961 B 0 B
./frontend/.nuxt/dist/client/components/v-audio-track.js 5.7 kB +8 B (0%)
./frontend/.nuxt/dist/client/components/v-audio-track.modern.js 5.66 kB -3 B (0%)
./frontend/.nuxt/dist/client/components/v-back-to-search-results-link.js 636 B 0 B
./frontend/.nuxt/dist/client/components/v-back-to-search-results-link.modern.js 643 B 0 B
./frontend/.nuxt/dist/client/components/v-bone.js 632 B 0 B
./frontend/.nuxt/dist/client/components/v-bone.modern.js 635 B 0 B
./frontend/.nuxt/dist/client/components/v-box-layout.js 1.35 kB 0 B
./frontend/.nuxt/dist/client/components/v-box-layout.modern.js 1.35 kB +1 B (0%)
./frontend/.nuxt/dist/client/components/v-collection-header.js 1.31 kB 0 B
./frontend/.nuxt/dist/client/components/v-collection-header.modern.js 1.31 kB 0 B
./frontend/.nuxt/dist/client/components/v-content-link.js 1.07 kB +1 B (0%)
./frontend/.nuxt/dist/client/components/v-content-link.modern.js 1.06 kB +1 B (0%)
./frontend/.nuxt/dist/client/components/v-content-page.js 530 B 0 B
./frontend/.nuxt/dist/client/components/v-content-page.modern.js 535 B +1 B (0%)
./frontend/.nuxt/dist/client/components/v-content-report-button.js 492 B 0 B
./frontend/.nuxt/dist/client/components/v-content-report-button.modern.js 496 B 0 B
./frontend/.nuxt/dist/client/components/v-content-report-form.js 3.33 kB -3 B (0%)
./frontend/.nuxt/dist/client/components/v-content-report-form.modern.js 3.21 kB -3 B (0%)
./frontend/.nuxt/dist/client/components/v-content-report-popover.js 3.79 kB -4 B (0%)
./frontend/.nuxt/dist/client/components/v-content-report-popover.modern.js 3.67 kB -9 B (0%)
./frontend/.nuxt/dist/client/components/v-copy-button.js 4 kB +3 B (0%)
./frontend/.nuxt/dist/client/components/v-copy-button.modern.js 4 kB +2 B (0%)
./frontend/.nuxt/dist/client/components/v-copy-license.js 2.34 kB +2 B (0%)
./frontend/.nuxt/dist/client/components/v-copy-license.modern.js 2.31 kB +3 B (0%)
./frontend/.nuxt/dist/client/components/v-dmca-notice.js 795 B 0 B
./frontend/.nuxt/dist/client/components/v-dmca-notice.modern.js 799 B 0 B
./frontend/.nuxt/dist/client/components/v-error-image.js 2.51 kB +1 B (0%)
./frontend/.nuxt/dist/client/components/v-error-image.modern.js 2.47 kB +4 B (0%)
./frontend/.nuxt/dist/client/components/v-error-section.modern.js 4.57 kB -7 B (0%)
./frontend/.nuxt/dist/client/components/v-external-search-form.js 4.1 kB -4 B (0%)
./frontend/.nuxt/dist/client/components/v-external-search-form.modern.js 3.43 kB -3 B (0%)
./frontend/.nuxt/dist/client/components/v-external-source-list.js 2.63 kB 0 B
./frontend/.nuxt/dist/client/components/v-external-source-list.modern.js 1.99 kB -1 B (0%)
./frontend/.nuxt/dist/client/components/v-full-layout.js 1.57 kB +2 B (0%)
./frontend/.nuxt/dist/client/components/v-full-layout.modern.js 1.57 kB -2 B (0%)
./frontend/.nuxt/dist/client/components/v-grid-skeleton.js 1.53 kB -8 B (-1%)
./frontend/.nuxt/dist/client/components/v-grid-skeleton.modern.js 1.53 kB -7 B (0%)
./frontend/.nuxt/dist/client/components/v-hide-button.js 577 B +1 B (0%)
./frontend/.nuxt/dist/client/components/v-hide-button.modern.js 573 B -1 B (0%)
./frontend/.nuxt/dist/client/components/v-home-gallery.js 4.28 kB -3 B (0%)
./frontend/.nuxt/dist/client/components/v-home-gallery.modern.js 4.26 kB -1 B (0%)
./frontend/.nuxt/dist/client/components/v-homepage-content.js 1.82 kB 0 B
./frontend/.nuxt/dist/client/components/v-homepage-content.modern.js 1.79 kB +1 B (0%)
./frontend/.nuxt/dist/client/components/v-image-cell.js 2.21 kB -1 B (0%)
./frontend/.nuxt/dist/client/components/v-image-cell.modern.js 2.19 kB -1 B (0%)
./frontend/.nuxt/dist/client/components/v-license-tab-panel.js 642 B 0 B
./frontend/.nuxt/dist/client/components/v-license-tab-panel.modern.js 649 B -1 B (0%)
./frontend/.nuxt/dist/client/components/v-load-more.js 1.18 kB 0 B
./frontend/.nuxt/dist/client/components/v-load-more.modern.js 1.07 kB 0 B
./frontend/.nuxt/dist/client/components/v-media-license.js 931 B +1 B (0%)
./frontend/.nuxt/dist/client/components/v-media-license.modern.js 940 B +1 B (0%)
./frontend/.nuxt/dist/client/components/v-media-reuse.js 3 kB +2 B (0%)
./frontend/.nuxt/dist/client/components/v-media-reuse.modern.js 2.97 kB +3 B (0%)
./frontend/.nuxt/dist/client/components/v-media-tag.js 416 B +1 B (0%)
./frontend/.nuxt/dist/client/components/v-media-tag.modern.js 420 B 0 B
./frontend/.nuxt/dist/client/components/v-media-tags.js 589 B +1 B (0%)
./frontend/.nuxt/dist/client/components/v-media-tags.modern.js 588 B 0 B
./frontend/.nuxt/dist/client/components/v-metadata-value.js 587 B 0 B
./frontend/.nuxt/dist/client/components/v-metadata-value.modern.js 593 B 0 B
./frontend/.nuxt/dist/client/components/v-metadata.js 1.3 kB 0 B
./frontend/.nuxt/dist/client/components/v-metadata.modern.js 1.31 kB +5 B (0%)
./frontend/.nuxt/dist/client/components/v-modal.js 980 B -2 B (0%)
./frontend/.nuxt/dist/client/components/v-modal.modern.js 973 B 0 B
./frontend/.nuxt/dist/client/components/v-no-results.js 2.67 kB +2 B (0%)
./frontend/.nuxt/dist/client/components/v-no-results.modern.js 2.03 kB 0 B
./frontend/.nuxt/dist/client/components/v-radio.js 1 kB -1 B (0%)
./frontend/.nuxt/dist/client/components/v-radio.modern.js 1.01 kB 0 B
./frontend/.nuxt/dist/client/components/v-related-audio.js 824 B 0 B
./frontend/.nuxt/dist/client/components/v-related-audio.modern.js 741 B 0 B
./frontend/.nuxt/dist/client/components/v-related-images.js 805 B -1 B (0%)
./frontend/.nuxt/dist/client/components/v-related-images.modern.js 719 B 0 B
./frontend/.nuxt/dist/client/components/v-report-desc-form.js 977 B -1 B (0%)
./frontend/.nuxt/dist/client/components/v-report-desc-form.modern.js 980 B -1 B (0%)
./frontend/.nuxt/dist/client/components/v-row-layout.js 1.72 kB 0 B
./frontend/.nuxt/dist/client/components/v-row-layout.modern.js 1.72 kB -1 B (0%)
./frontend/.nuxt/dist/client/components/v-safety-wall.js 1.44 kB 0 B
./frontend/.nuxt/dist/client/components/v-safety-wall.modern.js 1.44 kB -1 B (0%)
./frontend/.nuxt/dist/client/components/v-scroll-button.js 891 B 0 B
./frontend/.nuxt/dist/client/components/v-scroll-button.modern.js 891 B 0 B
./frontend/.nuxt/dist/client/components/v-search-results-title.js 617 B -1 B (0%)
./frontend/.nuxt/dist/client/components/v-search-results-title.modern.js 620 B -3 B (0%)
./frontend/.nuxt/dist/client/components/v-single-result-controls.js 1.17 kB +2 B (0%)
./frontend/.nuxt/dist/client/components/v-single-result-controls.modern.js 1.17 kB 0 B
./frontend/.nuxt/dist/client/components/v-sketch-fab-viewer.js 1.02 kB -1 B (0%)
./frontend/.nuxt/dist/client/components/v-sketch-fab-viewer.modern.js 916 B 0 B
./frontend/.nuxt/dist/client/components/v-snackbar.js 1.07 kB 0 B
./frontend/.nuxt/dist/client/components/v-snackbar.modern.js 1.07 kB -2 B (0%)
./frontend/.nuxt/dist/client/components/v-sources-table.js 14.7 kB 0 B
./frontend/.nuxt/dist/client/components/v-sources-table.modern.js 14.7 kB -1 B (0%)
./frontend/.nuxt/dist/client/components/v-warning-suppressor.js 306 B 0 B
./frontend/.nuxt/dist/client/components/v-warning-suppressor.modern.js 311 B 0 B
./frontend/.nuxt/dist/client/pages/about.js 1.42 kB 0 B
./frontend/.nuxt/dist/client/pages/about.modern.js 1.42 kB 0 B
./frontend/.nuxt/dist/client/pages/feedback.js 1.36 kB -1 B (0%)
./frontend/.nuxt/dist/client/pages/feedback.modern.js 1.36 kB -1 B (0%)
./frontend/.nuxt/dist/client/pages/image/_id/report.js 4.96 kB +2 B (0%)
./frontend/.nuxt/dist/client/pages/image/_id/report.modern.js 4.73 kB -2 B (0%)
./frontend/.nuxt/dist/client/pages/index.js 6.38 kB -1 B (0%)
./frontend/.nuxt/dist/client/pages/index.modern.js 6.35 kB +1 B (0%)
./frontend/.nuxt/dist/client/pages/preferences.js 1.46 kB 0 B
./frontend/.nuxt/dist/client/pages/preferences.modern.js 1.46 kB +1 B (0%)
./frontend/.nuxt/dist/client/pages/privacy.js 1.26 kB 0 B
./frontend/.nuxt/dist/client/pages/privacy.modern.js 1.26 kB 0 B
./frontend/.nuxt/dist/client/pages/search-help.js 1.63 kB +2 B (0%)
./frontend/.nuxt/dist/client/pages/search-help.modern.js 1.61 kB 0 B
./frontend/.nuxt/dist/client/pages/search/audio.js 502 B 0 B
./frontend/.nuxt/dist/client/pages/search/audio.modern.js 507 B 0 B
./frontend/.nuxt/dist/client/pages/search/image.js 460 B 0 B
./frontend/.nuxt/dist/client/pages/search/image.modern.js 462 B 0 B
./frontend/.nuxt/dist/client/pages/search/index.js 316 B 0 B
./frontend/.nuxt/dist/client/pages/search/index.modern.js 319 B -1 B (0%)
./frontend/.nuxt/dist/client/pages/search/model-3d.js 242 B -1 B (0%)
./frontend/.nuxt/dist/client/pages/search/model-3d.modern.js 246 B 0 B
./frontend/.nuxt/dist/client/pages/search/video.js 240 B 0 B
./frontend/.nuxt/dist/client/pages/search/video.modern.js 244 B 0 B
./frontend/.nuxt/dist/client/pages/sources.js 1.54 kB +1 B (0%)
./frontend/.nuxt/dist/client/pages/sources.modern.js 1.54 kB 0 B
./frontend/.nuxt/dist/client/runtime.js 2.78 kB -2 B (0%)
./frontend/.nuxt/dist/client/runtime.modern.js 2.78 kB -4 B (0%)
./frontend/.nuxt/dist/client/vendors/app.js 68.3 kB +1 B (0%)

compressed-size-action

@obulat obulat force-pushed the add/timeout-error-on-search branch from 445f129 to 702e90a Compare August 17, 2023 19:48
@github-actions github-actions bot added the 🧱 stack: documentation Related to Sphinx documentation label Aug 17, 2023
@github-actions
Copy link

github-actions bot commented Aug 17, 2023

Full-stack documentation: https://docs.openverse.org/_preview/2838

Please note that GitHub pages takes a little time to deploy newly pushed code, if the links above don't work or you see old versions, wait 5 minutes and try again.

You can check the GitHub pages deployment action list to see the current status of the deployments.

@obulat obulat force-pushed the add/timeout-error-on-search branch 3 times, most recently from 14e3ff4 to 05b75f0 Compare August 18, 2023 06:53
@obulat obulat changed the base branch from main to refactor-error-page August 18, 2023 10:15
@obulat obulat force-pushed the add/timeout-error-on-search branch from 05b75f0 to 1018fca Compare August 18, 2023 10:18
@obulat obulat force-pushed the refactor-error-page branch 2 times, most recently from fcada3e to 35b44f0 Compare August 18, 2023 10:23
@obulat obulat force-pushed the add/timeout-error-on-search branch 2 times, most recently from d64fcc1 to 4fcc5bf Compare August 18, 2023 10:37
@obulat obulat force-pushed the add/timeout-error-on-search branch from 4fcc5bf to ff10773 Compare August 18, 2023 11:58
@obulat obulat mentioned this pull request Aug 18, 2023
8 tasks
@obulat obulat force-pushed the refactor-error-page branch 2 times, most recently from 3016353 to 632c439 Compare August 18, 2023 12:35
@obulat obulat force-pushed the add/timeout-error-on-search branch from ff10773 to dd97dc2 Compare August 18, 2023 12:40
@obulat obulat force-pushed the add/timeout-error-on-search branch 2 times, most recently from 5032b2f to 37b4588 Compare August 22, 2023 04:29
Comment on lines 10 to 12
/**
* The error codes Axios uses.
*/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stray comment?

return props.fetchingError?.message?.includes(NO_RESULT)
? NO_RESULT
: SERVER_TIMEOUT
return props.fetchingError.code === NO_RESULT ? NO_RESULT : SERVER_TIMEOUT
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Can be simplified into an arrow function expression.

@obulat obulat requested a review from krysal September 18, 2023 17:40
@obulat obulat force-pushed the add/timeout-error-on-search branch 4 times, most recently from 89d4790 to c54f270 Compare September 21, 2023 02:25
@openverse-bot
Copy link
Collaborator

Based on the high urgency of this PR, the following reviewers are being gently reminded to review this PR:

@krysal
@AetherUnbound
This reminder is being automatically generated due to the urgency configuration.

Excluding weekend1 days, this PR was ready for review 7 day(s) ago. PRs labelled with high urgency are expected to be reviewed within 2 weekday(s)2.

@obulat, if this PR is not ready for a review, please draft it to prevent reviewers from getting further unnecessary pings.

Footnotes

  1. Specifically, Saturday and Sunday.

  2. For the purpose of these reminders we treat Monday - Friday as weekdays. Please note that the operation that generates these reminders runs at midnight UTC on Monday - Friday. This means that depending on your timezone, you may be pinged outside of the expected range.

Copy link
Collaborator

@AetherUnbound AetherUnbound left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! One comment, and: in addition to the changed tests, should there be any new tests? And do we need any new snapshots or does the error grouping reflect pages which already exist?

Comment on lines +20 to +22
* The error codes Axios uses.
* @see https://github.com/axios/axios/blob/9588fcdec8aca45c3ba2f7968988a5d03f23168c/lib/core/AxiosError.js#L57C2-L71
*/
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any chance this list could change? Is there any way to reference it directly in Axios? 😮

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could change, but there is no way of importing the list of error kinds directly from Axios :(

Comment on lines +136 to 150
mediaStore.fetchState.hasStarted &&
fetchingError.value !== null &&
!isRetriable(fetchingError.value)
if (shouldNotRefetch) return

const results = await mediaStore.fetchMedia(payload)
if (!results) {
const error = mediaStore.fetchState.fetchingError
/**
* NO_RESULT error is handled by the VErrorSection component in the child pages.
* For all other errors, show the Nuxt error page.
*/
if (
error !== null &&
!error?.message?.toLowerCase().includes(NO_RESULT) &&
!error?.message?.toLowerCase().includes("timeout")
) {
return nuxtError(error)
}
await mediaStore.fetchMedia(payload)

if (
fetchingError.value === null ||
handledClientSide(fetchingError.value)
) {
return null
}
return null
return nuxtError(fetchingError.value)
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels much more robust!

export const isRetriable = (error: FetchingError) => {
const { statusCode, code } = error
return !(
(statusCode && [429, 404, 500].includes(statusCode)) ||
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We perform very similar logic on L59 above, does it make sense to group these two at all?

@obulat obulat force-pushed the add/timeout-error-on-search branch 2 times, most recently from e7a99c2 to d500d4e Compare October 2, 2023 09:43
@obulat obulat force-pushed the add/timeout-error-on-search branch from bd30ccc to fdfe1f5 Compare October 2, 2023 14:59
@obulat obulat merged commit b94e60f into main Oct 2, 2023
41 checks passed
@obulat obulat deleted the add/timeout-error-on-search branch October 2, 2023 15:24
ngken0995 pushed a commit to ngken0995/openverse that referenced this pull request Oct 3, 2023
* Show timeout errors on the frontend

* Use FetchingError in all stores

* Fix error

* Show client-side errors on single result pages

* Set 500 as a non-retriable error

* Add changes from code review

* Use local base64 image for thumbnail

* Fix footer

* Fix image-cell test

* Extract common error checking functionality

* Update unit tests
ngken0995 added a commit to ngken0995/openverse that referenced this pull request Oct 4, 2023
…WordPress#3055)

* change deprecated ES search body

* trim white space

Add thumbnail repsonse time runbooks (WordPress#3053)

* Add thumb repsonse time runbooks

* Add files to index

* Threshold alarms are low severity if not anomalous

generate-dag-docs recipe move DAGs.md to documentation folder (WordPress#3061)

Co-authored-by: Madison Swain-Bowden <[email protected]>

Upgrade psycopg to version 3 in the API (WordPress#3064)

Update VSourcesTable.vue (WordPress#3026)

Co-authored-by: sarayourfriend <[email protected]>
Co-authored-by: Olga Bulat <[email protected]>
Co-authored-by: Krystle Salazar <[email protected]>

Transfer UUID validation inside serializer (WordPress#3068)

* Transfer UUID validation inside serializer

* Add test case

Publish changelog for api-2023.09.28.00.26.34 (WordPress#3070)

Co-authored-by: AetherUnbound <[email protected]>

Use fully qualified docker image names (WordPress#3071)

Publish changelog for ingestion_server-2023.09.29.17.40.50 (WordPress#3082)

Co-authored-by: stacimc <[email protected]>

Update `_AIRFLOW_DB_UPGRADE` to `_AIRFLOW_DB_MIGRATE`

Increase the API sources cache TTL from 20 minutes to 4 hours (WordPress#3083)

Publish changelog for api-2023.09.30.00.15.32 (WordPress#3084)

Co-authored-by: AetherUnbound <[email protected]>

Bump ipython from 8.14.0 to 8.16.0 in /automations/python (WordPress#3099)

Bumps [ipython](https://github.com/ipython/ipython) from 8.14.0 to 8.16.0.
- [Release notes](https://github.com/ipython/ipython/releases)
- [Commits](ipython/ipython@8.14.0...8.16.0)

---
updated-dependencies:
- dependency-name: ipython
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

Remove boto3 dependency (WordPress#3073)

Bump docker/login-action from 2 to 3 (WordPress#3089)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

Bump elasticsearch from 8.8.2 to 8.10.0 in /api (WordPress#3103)

Bumps [elasticsearch](https://github.com/elastic/elasticsearch-py) from 8.8.2 to 8.10.0.
- [Release notes](https://github.com/elastic/elasticsearch-py/releases)
- [Commits](elastic/elasticsearch-py@v8.8.2...v8.10.0)

---
updated-dependencies:
- dependency-name: elasticsearch
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

Bump psycopg2 from 2.9.7 to 2.9.8 in /ingestion_server (WordPress#3097)

Bumps [psycopg2](https://github.com/psycopg/psycopg2) from 2.9.7 to 2.9.8.
- [Changelog](https://github.com/psycopg/psycopg2/blob/master/NEWS)
- [Commits](psycopg/psycopg2@2.9.7...2.9.8)

---
updated-dependencies:
- dependency-name: psycopg2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

Bump elasticsearch from 8.8.2 to 8.10.0 in /ingestion_server (WordPress#3095)

Bumps [elasticsearch](https://github.com/elastic/elasticsearch-py) from 8.8.2 to 8.10.0.
- [Release notes](https://github.com/elastic/elasticsearch-py/releases)
- [Commits](elastic/elasticsearch-py@v8.8.2...v8.10.0)

---
updated-dependencies:
- dependency-name: elasticsearch
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

Bump pygithub from 1.59.1 to 2.1.1 in /automations/python (WordPress#3102)

Bumps [pygithub](https://github.com/pygithub/pygithub) from 1.59.1 to 2.1.1.
- [Release notes](https://github.com/pygithub/pygithub/releases)
- [Changelog](https://github.com/PyGithub/PyGithub/blob/main/doc/changes.rst)
- [Commits](PyGithub/PyGithub@v1.59.1...v2.1.1)

---
updated-dependencies:
- dependency-name: pygithub
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

Bump furo from 2023.8.19 to 2023.9.10 in /documentation (WordPress#3092)

Bumps [furo](https://github.com/pradyunsg/furo) from 2023.8.19 to 2023.9.10.
- [Release notes](https://github.com/pradyunsg/furo/releases)
- [Changelog](https://github.com/pradyunsg/furo/blob/main/docs/changelog.md)
- [Commits](pradyunsg/furo@2023.08.19...2023.09.10)

---
updated-dependencies:
- dependency-name: furo
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

Bump docker/build-push-action from 4 to 5 (WordPress#3090)

Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 4 to 5.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](docker/build-push-action@v4...v5)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

Bump actions/checkout from 3 to 4 (WordPress#3088)

Bump docker/setup-buildx-action from 2 to 3 (WordPress#3087)

Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 2 to 3.
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](docker/setup-buildx-action@v2...v3)

---
updated-dependencies:
- dependency-name: docker/setup-buildx-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

Bump fakeredis from 2.18.0 to 2.19.0 in /api (WordPress#3100)

Bumps [fakeredis](https://github.com/cunla/fakeredis-py) from 2.18.0 to 2.19.0.
- [Release notes](https://github.com/cunla/fakeredis-py/releases)
- [Commits](cunla/fakeredis-py@v2.18.0...v2.19.0)

---
updated-dependencies:
- dependency-name: fakeredis
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

Show timeout errors on the frontend (WordPress#2838)

* Show timeout errors on the frontend

* Use FetchingError in all stores

* Fix error

* Show client-side errors on single result pages

* Set 500 as a non-retriable error

* Add changes from code review

* Use local base64 image for thumbnail

* Fix footer

* Fix image-cell test

* Extract common error checking functionality

* Update unit tests

Add runbooks for API Thumbnails 2XX/5XX responses and Request Count alarms (WordPress#3076)

Bump jsonschema from 4.19.0 to 4.19.1 in /ingestion_server (WordPress#3098)

Bumps [jsonschema](https://github.com/python-jsonschema/jsonschema) from 4.19.0 to 4.19.1.
- [Release notes](https://github.com/python-jsonschema/jsonschema/releases)
- [Changelog](https://github.com/python-jsonschema/jsonschema/blob/main/CHANGELOG.rst)
- [Commits](python-jsonschema/jsonschema@v4.19.0...v4.19.1)

---
updated-dependencies:
- dependency-name: jsonschema
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

Bump ipython from 8.15.0 to 8.16.1 in /ingestion_server (WordPress#3110)

Bumps [ipython](https://github.com/ipython/ipython) from 8.15.0 to 8.16.1.
- [Release notes](https://github.com/ipython/ipython/releases)
- [Commits](https://github.com/ipython/ipython/commits)

---
updated-dependencies:
- dependency-name: ipython
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

Bump sphinx from 7.2.5 to 7.2.6 in /documentation (WordPress#3091)

Bumps [sphinx](https://github.com/sphinx-doc/sphinx) from 7.2.5 to 7.2.6.
- [Release notes](https://github.com/sphinx-doc/sphinx/releases)
- [Changelog](https://github.com/sphinx-doc/sphinx/blob/master/CHANGES.rst)
- [Commits](sphinx-doc/sphinx@v7.2.5...v7.2.6)

---
updated-dependencies:
- dependency-name: sphinx
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

Bump tldextract from 3.4.4 to 3.6.0 in /catalog (WordPress#3093)

Bumps [tldextract](https://github.com/john-kurkowski/tldextract) from 3.4.4 to 3.6.0.
- [Release notes](https://github.com/john-kurkowski/tldextract/releases)
- [Changelog](https://github.com/john-kurkowski/tldextract/blob/master/CHANGELOG.md)
- [Commits](john-kurkowski/tldextract@3.4.4...3.6.0)

---
updated-dependencies:
- dependency-name: tldextract
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

Bump urllib3 from 2.0.5 to 2.0.6 in /documentation (WordPress#3120)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

Bump urllib3 from 1.26.16 to 1.26.17 in /api (WordPress#3123)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

Bump urllib3 from 2.0.5 to 2.0.6 in /automations/python (WordPress#3119)

Bumps [urllib3](https://github.com/urllib3/urllib3) from 2.0.5 to 2.0.6.
- [Release notes](https://github.com/urllib3/urllib3/releases)
- [Changelog](https://github.com/urllib3/urllib3/blob/main/CHANGES.rst)
- [Commits](urllib3/urllib3@v2.0.5...2.0.6)

---
updated-dependencies:
- dependency-name: urllib3
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

Bump urllib3 from 1.26.16 to 1.26.17 in /ingestion_server (WordPress#3124)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

implement vale

determine files

mircosoft sentence format

change alert level

change alert level

change alert level

change alert level

change alert level

change alert level

change alert level

Empty-Commit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🕹 aspect: interface Concerns end-users' experience with the software ✨ goal: improvement Improvement to an existing user-facing feature 🟧 priority: high Stalls work on the project or its dependents 🧱 stack: documentation Related to Sphinx documentation 🧱 stack: frontend Related to the Nuxt frontend
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Use the timeout error page for timeout errors
5 participants