fix(ui): preserve flash message after keyboard refresh all feeds#4360
fix(ui): preserve flash message after keyboard refresh all feeds#4360leno23 wants to merge 1 commit into
Conversation
Use fetch redirect: manual for POST actions that rely on session flash messages. Automatic redirect following consumed the success alert before the browser navigation, so the R shortcut did not show the same feedback as the menu button. Fixes miniflux#4358 Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e29a21e1ba
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const locationHeader = response.headers.get("Location"); | ||
| if (locationHeader) { |
There was a problem hiding this comment.
Handle opaque redirect responses before navigating
This helper assumes it can read Location/redirect info after sendPOSTRequest(..., { redirect: "manual" }), but browser fetch returns an opaqueredirect response for server 302s in manual mode (empty headers and no usable redirect target). As a result, both redirect checks fail and execution falls through to window.location.reload(), so actions like /feeds/refresh do not navigate to the server’s redirect destination (/feeds) and the intended flash-message flow is still broken.
Useful? React with 👍 / 👎.
Summary
Rkeyboard shortcut not showing the success alert after refreshing all feedsfetchwithredirect: "manual"so session flash messages are not consumed before browser navigationRoot cause
The keyboard shortcut POSTed to
/feeds/refreshviafetch, which automatically followed the redirect to/feeds. That internal redirect request consumed the session flash message beforewindow.location.hrefnavigation, so the success alert was missing.The menu button uses a native form POST + redirect, so the flash message was shown correctly.
Test plan
/unread, pressRto refresh all feeds/feedsFixes #4358