mirror of
https://github.com/discourse/discourse.git
synced 2025-03-04 08:16:42 +08:00

When deleting a for_topic bookmark, we were calling bookmark.attachedTo() for the bookmarks:changed event, but the bookmark was not always a Bookmark model instance, so sometimes that call would error. Now we make sure that the bookmarks in the topic.bookmarks JS array are all bookmark model instances, and added a test to cover this deleting for_topic bookmark case as well.