Conversation
The global asset view showed "No assets in the global cache yet" for an
empty cache, a failed request and a search with no matches: a non-OK
response became { assets: [] }, a rejected request became [], and any
empty filtered list fell through to the empty-cache message.
Track loading, failed and loaded separately. A failed request shows a
failure message with a Try again button and no automatic retry. A
search that hides every record says nothing matches, and clearing it
restores the rows from memory without a second request. A successful
empty response keeps the existing guidance.
Fixes heygen-com#4385
This branch has not been deployed
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.
What
The global asset view now tells four situations apart: loading, a failed request, a successful empty cache, and a search that matches none of the cached assets. A failed request offers a "Try again" button.
Why
The view showed "No assets in the global cache yet" for an empty cache, a failed request and a search with no matches. A non-OK response was converted to
{ assets: [] }, a rejected request to[], and any empty filtered list fell through to the empty-cache message, so users were told their cache was empty when the data was unavailable or only filtered out.Related work
Fixes #4385 (approach posted on the issue first)
How
loading,failed,loaded) replaces the nullable records array.failed.loadingand re-runs the fetch effect. Nothing retries on its own.Test plan
GlobalAssetsView.test.tsxuses controlled fetch responses. Five of its six cases fail onmain, showing the empty-cache text for an error status, a rejected request and an unmatched search, and finding no way to retry.