-
-
Notifications
You must be signed in to change notification settings - Fork 70
closes #2327 - Word labels incorrectly removed when editing emoji #2352
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
Conversation
WalkthroughSwitches Emoji update to read-modify-write: loads persistent Emoji, updates fields, increments revision, saves persistent instance, and updates subsequent references (event association, Discord message, redirect) to use the persistent entity. Changes
Sequence Diagram(s)sequenceDiagram
participant U as User
participant C as EmojiEditController
participant D as EmojiDao
participant E as EmojiContributionEventService
participant N as DiscordNotifier
U->>C: POST /content/emoji/edit (emoji form data)
C->>D: findById(emoji.id)
D-->>C: persistentEmoji
C->>C: Update fields on persistentEmoji<br/>Increment revision
C->>D: save(persistentEmoji)
D-->>C: saved persistentEmoji
C->>E: createEvent(persistentEmoji, revision)
E-->>C: event created
C->>N: sendEditNotification(persistentEmoji.glyph, revision)
C-->>U: Redirect to /content/emoji/edit/{persistentEmoji.id}
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing touches
🧪 Generate unit tests
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (12)
🔇 Additional comments (4)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2352 +/- ##
============================================
- Coverage 16.84% 16.83% -0.01%
Complexity 465 465
============================================
Files 264 264
Lines 7848 7852 +4
Branches 903 903
============================================
Hits 1322 1322
- Misses 6450 6454 +4
Partials 76 76 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, @odanko01
Another solution would be to include the IDs of the word labels as a hidden input field inside the
<form:form modelAttribute="emoji">element in the edit.jsp file.
But your solution also works, so approving your PR for merging 👍
|
@odanko01 Congrats on your first pull request contribution! 🎉 If you would like to be included in our monthly token allocations, please add your Ethereum address to |
### Issue Number
### Purpose
Technical Details
Emojiobject passed tohandleSubmitcontainednullin thewordsfield. When callingemojiDao.update(emoji), this overwrote the existingwordsin the database withnull, causing them to be removed.emojiobject, the persistentexistingEmojiis loaded from the database. Its scalar fields (glyph,unicodeVersion,unicodeEmojiVersion,revisionNumber) are updated, and thenemojiDao.update(existingEmoji)is called. This preserves the associatedwords.Testing Instructions
Screenshots