Version 2026.10.0-latest (a51251632c), nested_replies_enabled, default sort old. The route code involved looks the same on current main.
Steps
- Bookmark a topic (topic-level bookmark) that uses the nested view, and read it to the end.
- Open that topic normally, then go to a topic list such as /latest, without reloading the page.
- Open the user menu, go to the Bookmarks tab and click the bookmark.
Expected: the topic opens and the bookmark button shows “Edit bookmark”.
Actual: no replies are shown, the button shows “Bookmark”, and clicking it shows “Sorry, an error has occurred.” With a fresh page load instead of step 2, the button is right but the topic still shows no replies.
What happens
UserTopicBookmarkSerializer#bookmarkable_urllinks tolast_read_post_number + 1. For a fully read topic that post doesn’t exist. Example:/t/slug/818/2whenhighest_post_numberis 1. The flat view jumps to the nearest post, but the nested route requests/n/slug/818/context/2.json, which returns 404.- In
routes/topic/from-params.js, iftopic.is_nested_viewis already set,postStream.refreshis skipped. The 404 from the nested load then sets_loading_errorandsetupControllerreturns early, so the topic controller keeps the store record exactly as it was. - That record’s
bookmarksis[]. A topic list load runsTopic.mungewith list JSON, which hasbookmarkedbut nobookmarks, andmungesetsbookmarks = e.bookmarks || []on the cached record. The button readsbookmarks, so it offers to create a new topic bookmark. Presumably the server rejects that because one already exists.
This is the same failure path as Link to nested topic in my suggested topics doesn't work, whose fix covered suggested-topic links only.
Possible fixes: let the context endpoint or the route fall back to the nearest existing post, as the flat view does, and/or don’t keep the previous topic state when _loading_error is set. Limiting bookmarkable_url to highest_post_number would also remove this trigger.