Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor "nearby" sharing notifications #3161

Open
toland opened this issue Mar 13, 2020 · 2 comments
Open

Refactor "nearby" sharing notifications #3161

toland opened this issue Mar 13, 2020 · 2 comments
Assignees

Comments

@toland
Copy link
Contributor

toland commented Mar 13, 2020

We've found an oddity when two users are both sharing their location when nearby. We send notifications and set the nearby flag for pushing user locations when a user uploads their location. In the case where both users are sharing nearby, we already know whether the other user is nearby or not without them uploading another location data point. We should go ahead and send notifications and update the internal state without waiting for the other user to upload a location.

There is a chance of a race condition here, and I'm not sure how to address that. Perhaps by pushing the updates through the other user's location processing handler.

@toland toland self-assigned this Mar 13, 2020
@bernardd
Copy link
Contributor

I wouldn't get too stressed about the race condition - it will resolve next time either user uploads a location, and the actual impact will be pretty minor if indeed it's noticeable at all. I think this is one of those cases where we can just cover our ears and go "lalalalala eventually consistent".

@toland
Copy link
Contributor Author

toland commented Mar 16, 2020

That is the approach that I went with. We can deal with the race condition when and if it becomes a problem.

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

No branches or pull requests

2 participants