Repository navigation
Fix: stop the admin UI announcing saves that failed - #38
Merged
Merged
Conversation
Turning certificate verification off is now decided in one place and only ever applies to a host on the local network. The server-wide setting was already scoped that way; the per-app switch and the per-request flag were handed straight to the transport, and those are the paths that carry a stored credential. Session tokens now expire after 12 hours idle rather than 30 days, and a session still in use is reissued once it is past halfway, so the shorter window bounds an unused token without signing anyone out mid-task.
The seeding helper posts through an API request context, which is not a page and so states no origin. Writes now require one, which refused every seed. The address comes from the same definition the Playwright config resolves relative paths against, so the two cannot drift apart.
save() already reported whether the write reached the server, but no caller read the result. A failed write toasted "Save failed" and was immediately overwritten by "Updated", "Added" or "Imported" in the same shared toast element, and the item editor closed on top of it. The list edits had the same gap from the other side: delete, reorder, drag-drop, the Settings hide toggle and every folder-membership change mutate the in-memory list and save after, with no path back if the save failed. The admin list then showed a dashboard the server did not have until a reload. Add snapshotItems and saveWithRevert to the save logic, take a snapshot before each mutation, and put the list back when the write does not land. The item editor now stays open on failure so the filled-in form is not discarded. The label-visibility toggles were wired straight to change with no catch, so a failure was an unhandled rejection with no message and the switch left in its new position.
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
snapshotItemsandsaveWithReverttoadmin-save-logic.js, and asaveOrRevertwrapper inadmin.jsthat restores the item list and re-renders when a write does not reach the server.closeModalindoSaveon the save result, so a failed write leaves the editor open with the form intact instead of reporting success over its own error toast.saveLabelsin a catch that restores the toggled checkbox and reports the error, instead of leaving an unhandled rejection and a switch the server never agreed to.Testing
All green. Added 6 tests covering
snapshotItemscloning andsaveWithReverton success, reported failure, a throw, and a void return.Checklist