You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a user sets an initial presence while attaching a document, a presence-changed event is triggered with an undefined presence value. This is because when publishing the presence-changed event, the presence is retrieved using getPresence, which only returns presence for online clients.
What you expected to happen:
The value of the presence-changed event should include the initial presence value set by the user.
How to reproduce it (as minimally and precisely as possible):
Execute following code:
it.only('initial presence',asyncfunction({ task }){constc1=newyorkie.Client(testRPCAddr);awaitc1.activate();constc1ID=c1.getID()!;constdocKey=toDocKey(`${task.name}-${newDate().getTime()}`);constevents1=newEventCollector<DocEvent>();typePresenceType={key: string};constdoc1=newyorkie.Document<{},PresenceType>(docKey);constunsub1=doc1.subscribe('presence',(event)=>events1.add(event));awaitc1.attach(doc1,{initialPresence: {key: 'val1'},});awaitevents1.waitAndVerifyNthEvent(1,{type: DocEventType.PresenceChanged,value: {clientID: c1ID,presence: {key: 'val1'}},// presence value is missing });unsub1();});
What happened:
When a user sets an initial presence while attaching a document, a
presence-changed
event is triggered with anundefined
presence value. This is because when publishing thepresence-changed
event, the presence is retrieved usinggetPresence,
which only returns presence for online clients.What you expected to happen:
The value of the
presence-changed
event should include the initial presence value set by the user.How to reproduce it (as minimally and precisely as possible):
Execute following code:
Anything else we need to know?:
Related: yorkie-team/yorkie#671
Environment:
yorkie version
):The text was updated successfully, but these errors were encountered: