-
Notifications
You must be signed in to change notification settings - Fork 213
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
Simplify media FetchState
and fix fetching errors
#5323
base: main
Are you sure you want to change the base?
Conversation
b31b1f9
to
af9a134
Compare
Latest k6 run output1
Footnotes
|
fda6fbe
to
467d6e1
Compare
Fixes #5322 --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/WordPress/openverse/issues/5322?shareId=XXXX-XXXX-XXXX-XXXX).
467d6e1
to
aa359a0
Compare
FetchState
and fix fetching errors
Playwright failure test results: https://github.com/WordPress/openverse/actions/runs/12688482927 It looks like some of the Playwright tests failed. If you made changes to the frontend UI without updating snapshots, this might be the cause. You can download zipped patches containing the updated snapshots alongside a general trace of the tests under the "Artifacts" section in the above page. They're named in the form You can read more on how to use these artifacts in the docs. If the test is flaky, follow the flaky test triage procedure. |
Fixes
Fixes #5322
Fixes #5325
Description
This PR replaces the flags used in
FetchState
with singlestatus
property, and an additionalerror
property. To prevent invalid states where status is noterror
, but there's error, the type uses TypeScript discriminated union.Some other changes:
fetchMedia
returns theResults
type that is a discriminated union (so, thetype
property determines the type of the items in theitems
list)Testing instructions
Run the app using
ov just frontend/run dev
Search for "bamberg" and try the steps in #5325 - the errors from the issue should be fixed.
Fetching the media should work properly, both in the client and in SSR.
When the first page of results is loading on All media content, the content links should not say "No results", but should show "Loading..." label instead.
I tried creating a PR completely using the GitHub copilot, but I had to add a lot of changes on the first version: Copilot Workspace session.