-
-
Notifications
You must be signed in to change notification settings - Fork 418
chore: track pending update count #1494
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
base: main
Are you sure you want to change the base?
Conversation
Reviewer's GuideAdds an atomic pending-update counter to CachedCollab, hooks increment/decrement calls into the local-update send/ack pipeline, optimizes redundant diff messages when state is already in sync, and fixes minor defaults and code cleanup in the WS2 workspace actor. Sequence diagram for local update send/ack and pending update countsequenceDiagram
participant Client
participant WorkspaceControllerActor
participant CachedCollab
Client->>WorkspaceControllerActor: Send local update
WorkspaceControllerActor->>CachedCollab: change_pending_count(object_id, +1)
WorkspaceControllerActor->>WorkspaceControllerActor: trigger send
WorkspaceControllerActor->>Client: (possibly error)
WorkspaceControllerActor->>CachedCollab: change_pending_count(object_id, -1) (on ack)
Class diagram for CachedCollab and pending update trackingclassDiagram
class CachedCollab {
- WeakCollabRef collab_ref
- CollabType collab_type
- AtomicU64 pending_updates
+ upgrade() Option<CollabRef>
+ pending_updates() u64
}
class WorkspaceControllerActor {
+ change_pending_count(object_id: &ObjectId, by: i64) Option<u64>
+ remove_collab(object_id: &ObjectId)
+ handle_send(msg: ClientMessage, source: ActionSource) async
}
WorkspaceControllerActor --> CachedCollab : manages
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
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.
Hey @Horusiath - I've reviewed your changes and they look great!
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Summary by Sourcery
Track pending update count per collaboration session to improve synchronization and reduce redundant update messages, and apply minor protocol fixes.
Enhancements:
pending_updates
atomic counter andchange_pending_count
method toCachedCollab
last_message_id
in manifest responses instead of the defaultWsInput
handler to clone the manager store in the correct scope