[BWS, BWC] TSS - add copayerReady event#4132
Conversation
| const p = session.participants.find(p => p.partyId === m.fromPartyId); | ||
| return p?.copayerId; | ||
| }).filter(Boolean) as string[]; | ||
| return { messages, signature: session.signature, participants }; |
There was a problem hiding this comment.
Are you wanting the participants to be returned to the client in real time? Currently, this logic is only hit once all participants have joined (per line 300: if (otherPartyMsgs.length === session.m - 1)). If you want it to be real time, we should move this new logic to be between lines 299-300 and then return participants in the returned object on line 311 (after the if block) as well.
There was a problem hiding this comment.
If we change it as noted above, then the client will just need to be aware that the copayerReady event will fire duplicates.
There was a problem hiding this comment.
Hey, yes thanks. I moved that logic outside of the if. I also added an emittedParticipants array to avoid duplicates on the client side. In any case, this shouldn’t cause any issues in the app, since it’s just used to show a checkmark next to the copayer’s name in the UI.
5dc7ca6 to
178c5f6
Compare
178c5f6 to
ab6f7dd
Compare
Description
Adds a copayerReady event to TssSign (BWC) so callers can track which copayers have joined a signing session in real time.
Changelog
Testing Notes
Add any helpful notes for reviewers to test your code here.
Checklist