Skip to content

Commit

Permalink
Remove noisy exception when parsing stream joins (#1918)
Browse files Browse the repository at this point in the history
There is a real bug here, but I don't know what it is. This is too noisy
though, sorry for not killing it sooner.:wq
  • Loading branch information
texuf authored Dec 30, 2024
1 parent fb6effb commit 5ab6065
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions packages/sdk/src/streamStateView_Members.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,15 @@ import { isDefined, logNever } from './check'
import { userIdFromAddress } from './id'
import { StreamStateView_Members_Membership } from './streamStateView_Members_Membership'
import { StreamStateView_Members_Solicitations } from './streamStateView_Members_Solicitations'
import { bin_toHexString, check } from '@river-build/dlog'
import { bin_toHexString, check, dlog } from '@river-build/dlog'
import { DecryptedContent } from './encryptedContentTypes'
import { StreamStateView_MemberMetadata } from './streamStateView_MemberMetadata'
import { KeySolicitationContent } from '@river-build/encryption'
import { makeParsedEvent } from './sign'
import { StreamStateView_AbstractContent } from './streamStateView_AbstractContent'

const log = dlog('csb:streamStateView_Members')

export type StreamMember = {
userId: string
userAddress: Uint8Array
Expand Down Expand Up @@ -183,7 +185,12 @@ export class StreamStateView_Members extends StreamStateView_AbstractContent {
const userId = userIdFromAddress(membership.userAddress)
switch (membership.op) {
case MembershipOp.SO_JOIN:
check(!this.joined.has(userId), 'user already joined')
if (this.joined.has(userId)) {
// aellis 12/24 there is a real bug here, not sure why we
// are getting duplicate join events
log('user already joined', this.streamId, userId)
return
}
this.joined.set(userId, {
userId,
userAddress: membership.userAddress,
Expand Down

0 comments on commit 5ab6065

Please sign in to comment.