🐛 fix(duplicate-event): fix event duplication - backend#1000
Merged
victor-enogwe merged 2 commits intomainfrom Sep 26, 2025
Merged
🐛 fix(duplicate-event): fix event duplication - backend#1000victor-enogwe merged 2 commits intomainfrom
victor-enogwe merged 2 commits intomainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes a bug where event duplication was not working correctly in the backend. The issue was that the event duplication functionality was treating duplicate operations as edit operations instead of create operations, causing duplicates to overwrite the original events.
Key changes:
- Moved the logic for handling event IDs (removing optimistic prefixes and generating new IDs) to the
processEventsmethod - Simplified the payload creation in the POST endpoint to only add the user field
- Added console logging for debugging
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Backend fix
The duplicate functionality was completely broken for both calendar and someday events. When users attempted to duplicate an event via right-click context menu or the Meta+D keyboard shortcut, no new event was created and the UI did not update. This regression was introduced in commit
2de11dfduring the recent refactoring of draft actions.Root Cause
The
duplicateEventfunction inuseDraftActions.tswas incorrectly passing the original event's_idto the submit function:When an event has an existing
_id, the submit function treats it as an edit operation rather than a create operation, causing the duplicate to overwrite the original event instead of creating a new one.