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

Fix looking for peers forever in iOS #37

Closed
yaronyg opened this Issue Jul 20, 2015 · 2 comments

Comments

Projects
None yet
1 participant
@yaronyg
Member

yaronyg commented Jul 20, 2015

Right now our iOS discovery code will discover a peer via BLE exactly once. The reason is that we have suppressed multiple discovery notifications because otherwise we get hit about 1000 times a second (yes, literally) with notifications.

The problem is that once we suppress duplicates it means we will literally, never get a notification for that user again (at least as long as the app keeps running, including time in the background).

So what do we do when the user leaves the area? The answer is that we have a long poll BLE connection request to EVERYBODY we discover. And we keep this connection request indefinitely. So if the person disappears the request will fail and we will know and if they come back the request will again work and we will know they are there.

But this potentially means that our list of discovered peers can grow without bound. It's not clear in practice how big a deal this is since presumably when we put in the correct discovery framework we will only bother with the long poll for peers we have ever had anything to do with. But it's still not ideal.

It seems that if we turn discovery off and back on then the iOS device will clear the cached identities it isn't providing notifications for and we can start afresh. For security reasons (we don't want to expose our identity by constantly connecting to the same people) we probably want to periodically turn off and on discovery to clear the list.

@yaronyg yaronyg added the 1 - Backlog label Nov 18, 2015

@yaronyg yaronyg added 0 - Icebox and removed 1 - Backlog labels Jan 5, 2016

@yaronyg

This comment has been minimized.

Show comment
Hide comment
@yaronyg

yaronyg Apr 1, 2016

Member

Note that probably the easiest way to do this is to put in logic in the node layer that just turns advertising on and off.

Member

yaronyg commented Apr 1, 2016

Note that probably the easiest way to do this is to put in logic in the node layer that just turns advertising on and off.

@yaronyg

This comment has been minimized.

Show comment
Hide comment
@yaronyg

yaronyg Apr 7, 2016

Member

Also note that this only applies to the BLE code which we are NOT currently using at all.

Member

yaronyg commented Apr 7, 2016

Also note that this only applies to the BLE code which we are NOT currently using at all.

@yaronyg yaronyg modified the milestone: V1 Aug 3, 2016

@yaronyg yaronyg added the iOS label Sep 1, 2016

@yaronyg yaronyg closed this Sep 26, 2016

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