-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Problem
When doing batch operations (like adding multiple events at once), the backup for undo/rollback only keeps references to the same Event objects. If something fails partway through, the rollback doesn't actually restore the old state.
File: core/events/EventStore.js
What happens
- You start a batch add of 10 events
- Events 1-5 succeed and modify the store
- Event 6 fails
- Rollback tries to restore, but the "backup" points to the same modified objects
- Data is corrupted
How to fix
Create actual copies of events before the batch operation:
batchAdd(events) {
const backup = new Map();
for (const [id, event] of this.events) {
backup.set(id, event.clone()); // Make real copies
}
// ... rest of batch logic
}This way rollback has clean copies to restore from.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working