Conversation
There was a problem hiding this comment.
Pull request overview
This PR removes a broadcast call for document steps after processing a document update, likely as part of implementing a different broadcasting strategy or removing unnecessary real-time notifications.
Changes:
- Removed
broadcastStepscall in the document update flow
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -163,7 +163,6 @@ export class DocumentRoute extends BaseRoute { | |||
| payload, | |||
| user | |||
| ) | |||
There was a problem hiding this comment.
Removing the broadcastSteps call may break real-time synchronization for collaborative editing. If this broadcast is no longer needed, ensure that step broadcasting is handled elsewhere in the application flow, or verify that real-time updates are intentionally being disabled.
| ) | |
| ) | |
| await this.documentController.broadcastSteps(projectID, manuscriptID, payload, user) |
| this.documentController.broadcastSteps(manuscriptID, result) | ||
| res.status(StatusCodes.OK).send(result) | ||
| } |
There was a problem hiding this comment.
Why are we getting rid of this?
There was a problem hiding this comment.
because the worker will be responsible to broadcast the steps.
There was a problem hiding this comment.
Even locally? And on dev environments? We currently have the worker only on dev2.
There was a problem hiding this comment.
I don’t think we need this locally. I think we should enable it across all environments.
As a fallback, we could implement an alternative approach, but I need to figure out how to support that in the API repo.
There was a problem hiding this comment.
This was the fallback, so we don't have to run the worker locally. We do need a way to to send steps back to the FE from the BE, no?
There was a problem hiding this comment.
The new implementation keeps the POST request as a fallback, allowing the FE to send steps to the BE and receive them back without broadcasting.
However, it’s not clear how this acts as a fallback. With the current implementation, it seems to introduce a redundant step.
There was a problem hiding this comment.
We send steps back to the FE. This is needed if multiple users are editing the same document.
There was a problem hiding this comment.
yes, now the worker will be responsible to handle this.
But I think we can keep it as a fallback and make it working only when the user send the steps by post request.
here is the worker pr: https://github.com/atypon/manuscripts-cf-worker/pull/5
No description provided.