File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
packages/framework/attributor/src Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change 6
6
import { type IDeltaManager } from "@fluidframework/container-definitions" ;
7
7
import { assert } from "@fluidframework/core-utils/internal" ;
8
8
import {
9
+ MessageType ,
9
10
type IDocumentMessage ,
10
11
type IQuorumClients ,
11
12
type ISequencedDocumentMessage ,
@@ -91,10 +92,12 @@ export class OpStreamAttributor extends Attributor implements IAttributor {
91
92
) {
92
93
super ( initialEntries ) ;
93
94
deltaManager . on ( "op" , ( message : ISequencedDocumentMessage ) => {
94
- // TODO: Verify whether this should be able to handle server-generated ops (with null clientId)
95
- const client = quorumClients . getMember ( message . clientId as string ) ;
96
- if ( message . type === "op" ) {
97
- // TODO: This case may be legitimate, and if so we need to figure out how to handle it.
95
+ if ( message . type === MessageType . Operation ) {
96
+ assert (
97
+ typeof message . clientId === "string" ,
98
+ "Client id should be present and should be of type string" ,
99
+ ) ;
100
+ const client = quorumClients . getMember ( message . clientId ) ;
98
101
assert ( client !== undefined , "Received message from user not in the quorumClients" ) ;
99
102
this . keyToInfo . set ( message . sequenceNumber , {
100
103
user : client . client . user ,
You can’t perform that action at this time.
0 commit comments