DnD'ing events too quickly results in forced refresh page prompt
Where did this happen?
No response
Expected Behavior
If I drag and drop events in a quick fashion, I should be able to do it seamlessly.
Current Behavior
Drag and dropping events too quickly results in page prompting me to refresh
Steps to Reproduce
https://github.com/user-attachments/assets/01c66024-7f10-456b-b857-ea9c070f72fc
Possible Solution
This is very likely due to us refetching all events when events change, we would need a better mechanism to handle refetching events to be implemented in both backend and frontend
Context
No response
This makes a good case for batching calendar operations. Keeping a global DND state would also make sense here since you can only DND one item at a time. With a global DND state we can debounce fast and consecutive DND scenarios apply calendar changes after an interval and when there is an interlude in the DND operation.
The CompassEventsProcessor is designed for batch scenarios like this, allowing changes to multiple events be applied at once. This is predicated on the UI being able observe change deltas based on the currently on-screen documents.
The change deltas represnt the offline or in-browser calendar state to be synced and processed by the CompassEventsProcessor at intervals.
We can leverage libraries like yJs to model the calendar and events, observing event changes locally, replicating these changes on the Compass server and elsewhere etc.
This will require an Epic and needs more information.
I like the idea of debouncing and tracking DND state globally. That'll also make it easier to move to dnd-kit. Added this to track the frontend portion of this work: #982
Please create a feature to track the backend portion of this as you have time (not urgent), @victor-enogwe