You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In at least Safari in iOS 17.3, filling in story details and selecting tags, then tapping Preview generates a preview with no tags, and the tags are removed from the form field.
The text was updated successfully, but these errors were encountered:
I've narrowed this down to the addition of the .includes(:tag) step in Story.tags_a (line 683 of models/story.rb).
This appears to be because includes filters out taggings that are not yet written to the db, which applies to both :preview and :new when rendering a partially filled form/preview of a story not yet saved by the user.
This original change appears to have been introduced ~1 month ago in hopes to address an n_plus_one failure. Removing this line indeed causes n_plus_one failures to return for stories with multiple tags, both in :new and :edit of the story controller. While it doesn't solve the performance issue, I was able to work around the exception in dev mode by calling Prosopite.finish before hitting the db in both those functions.
Happy to send a pull request unless someone prefers to take this or address a fix in a different way. I have to admit I'm not happy with my abuse of Prosopite.finish(), and I was unable to figure out exactly where to place a pause/resume to prevent the failure (not for lack of trying either :).
In at least Safari in iOS 17.3, filling in story details and selecting tags, then tapping Preview generates a preview with no tags, and the tags are removed from the form field.
The text was updated successfully, but these errors were encountered: