Skip to content

Conversation

@jrconlin
Copy link
Member

@jrconlin jrconlin commented Jun 11, 2024

there are reports of users registering a channel and the channel
immediately returning a 410. This does a simple check to see if the user
record still exists before registering. A user record may have been
removed for some reason while the user connection still persists and
this should catch for that.

Closes: SYNC-4294

jrconlin added 2 commits June 10, 2024 17:28
there are reports of users registering a channel and the channel
immediately returning a 410. This does a simple check to see if the user
record still exists before registering. A user record may have been
removed for some reason while the user connection still persists and
this should catch for that.

Closes: SYNC-4294
@jrconlin jrconlin requested review from pjenvey and taddes June 11, 2024 17:53
@jrconlin jrconlin marked this pull request as ready for review June 11, 2024 17:53
* also added function descriptor comment
@jrconlin
Copy link
Member Author

Thinking about this.
I'm not exactly sure how a device could get into this state. We auto-prune when the bridge rejects a connection, but there may be pre-connected UAs that haven't gotten the message about that.
For now, instead of creating a potentially invalid endpoint, let's do a check to see if the user record is present before we build the endpoint. (Fortunately, with Bigtable, we're not paying per read, but this might be worth the cost in any case.)

We might want to use something like a conditional write instead?

@pjenvey
Copy link
Member

pjenvey commented Jul 11, 2024

The original issue gives the impression that its root cause is a client side issue, especially with it originally being reported on Desktop which always generates its own channel_id (passing it to the server) when registering a new subscription.

So I think we should close this (or at least set as draft) until some digging is done to rule out client side issues being the root cause.

@jrconlin jrconlin marked this pull request as draft July 12, 2024 11:32
@jrconlin
Copy link
Member Author

Yeah, I'm fine making this a draft for now. I can see this being a bit of a problem, but hopefully, it's a fairly rare edge case.

Ok(predicate_matched)
}

async fn check_user(&self, uaid: &Uuid) -> DbResult<bool> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if this feature is ever needed: I think it would be better to move the check into add_channels itself. Its write would become a check_and_mutate depending on the existence of the row key (the same check used by add_user w/ a true instead of false filter)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants