Repository navigation
Fix: let the config export report a failure - #41
Merged
Merged
Conversation
The export set an anchor's href to the endpoint and clicked it, which hands the request to the browser. The page never learned the outcome, so the try/catch around the click could not observe one: a refusal, a server error or an expired session was written to disk as an error body under the backup's own filename. The failure surfaced when the backup was needed. Fetch it through ag instead, check the response, and save a blob built from it. An expired session now raises the sign-in box and the export finishes afterwards, since that is what every other admin request already does. The catalog already carried toast.exportFailed, which nothing could reach.
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
/api/config/exportthroughagand save a blob built from the response, instead of assigning the endpoint to an anchor'shrefand clicking it.toast.exportFailed, which nothing could previously reach; an expired session raises the sign-in box and the export completes afterwards.APIimport fromadmin.js.Testing
All green. Added 5 tests pinning the handler to the fetch route, the failure report, the object-URL release, and the existing download filename.
Checklist