bookmarks: don't fabricate a local save when the server rejects it #121
No reviewers
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: Jinemi/thermograph#121
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/bookmarks-integration"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Integration pass over PR #117 (bookmarked locations). Backend/frontend contract, alembic chain, and selectors all check out — one real defect found and fixed:
bookmarks.js'sadd()treated a server rejection the same as being offline. The POST to/bookmarkswas wrapped in try/catch with the comment "fall through so the star still visibly sticks, even offline" — but the fallthrough to the local-only path ran on any non-2xx response, not just a network exception. Hit the per-user cap (409) or send bad input (422) while signed in, and the star still lit up "Saved": a bookmark that was never created server-side, silently written into local cache and then dropped without explanation the next timesyncFromServerreconciles against the real list.Fix: only take the offline fallback on an actual fetch exception; a real HTTP rejection now throws so the caller sees it.
bookmarks-ui.js's star-toggle handler had no catch at all (an unhandled rejection), so it now surfaces the message viaalert(), matching the existing error pattern insubscriptions.js.Everything else checked out clean:
schemas.py/api_accounts.pyandbookmarks.js.POST /bookmarks/importreturns{imported, skipped, bookmarks}as bothsubscriptions.jsandbookmarks-ui.jsassume.DELETE/PATCH /bookmarks/{id}take anintpath param; the frontend'sString(b.id)values are always the server's numeric id when signed in, so they parse fine.create_bookmark(409) andimport_bookmarks(silently counts remaining items as skipped) — matchestest_bookmark_cap/test_bookmark_import_stops_at_cap..share,#results .loc-title h2,.find-bar,.controlsall exist inapp.js's render output /home.html.j2;--accent/--surface-2/--border/--mutedare all real tokens instyle.css.0004_bookmarks'sdown_revisionchains correctly off0003_user_discord_only→0002→0001(no branching).Not run: the local checkout at
~/Code/thermographpredates this feature (noBookmarkmodel, no0003/0004migrations, notest_bookmarks.pypresent), and shell access to update/test it was unavailable in this session — sotest_bookmarks.pywas verified by inspection against the implementation, not executed.