-
Notifications
You must be signed in to change notification settings - Fork 784
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Previewing a submission removes tags #1264
Comments
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: