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

Sharing nearby not working properly #4905

Open
mstidham opened this issue Mar 11, 2020 · 10 comments
Open

Sharing nearby not working properly #4905

mstidham opened this issue Mar 11, 2020 · 10 comments
Assignees

Comments

@mstidham
Copy link

Users that are nearby each other do not dynamically show sharing on the header or map (Pink ring around avatar is missing). However if the users move the action emoti appears on the header.

image

@mstidham
Copy link
Author

User will briefly see the avatar appear after android device does a kill/reload. Once the user taps on the map to go to the HS the avatar disappears from the map and becomes grey on the header.

image

@bengtan
Copy link
Contributor

bengtan commented Mar 12, 2020

Let's fix this:

Users that are nearby each other do not dynamically show sharing on the header or map (Pink ring around avatar is missing).

and then re-evaluate this:

However if the users move the action emoti appears on the header.

@aksonov
Copy link
Contributor

aksonov commented Mar 12, 2020

I was not able to reproduce such situation with iOS simulator, but found atleast one nearby issue. After one user A became nearby, another B sees him correctly, but A doesn't see B.

cc @southerneer

@toland As I understand the issue above happens because A doesn't receive 'nearby' start location (for B), but B - receives it normally (for A)

@mstidham
Copy link
Author

mstidham commented Mar 12, 2020

Note: If user A leaves (2km) and returns to the nearby User B and User B has the app open. User B will see User A properly sharing but once User B does a kill/reload they no longer appear sharing location nearby. I was able to easily reproduce this.
If users have the app closed when they become nearby, one user will receive the push notification but when they deep link it does not show they are sharing.

Steps to see user sharing:

  1. 2 users sharing live location "Nearby"
  2. 1 user leaves device at current location with app open and no screen lock on the device.
  3. 1 user drives for 2 km and then returns.
  4. Verify on device that is open and stationary that user is visible on header and map, then do a kill/reload on that device. User is now no longer sharing live location.

Steps to see user with motion emoti after deep link but not sharing:

  1. 2 user sharing live location "Nearby"
  2. Have the app in a killed state on device that remains at location
  3. Take other device (app in killed state) at least 2 km away from other device.
  4. Return to location
  5. 1 user will have received a push notification that other user is nearby
  6. Tap on push notification and the app will open with motion emoti but no other visible sign they are sharing.

@southerneer
Copy link
Contributor

I think the issue has to do with this line: https://github.com/hippware/rn-chat/blob/master/src/model/Profile.ts#L127

sharesLocation will only be true if shareType == ALWAYS but of course it should be true if shareType == NEARBY and the user is within the nearby radius. @toland is adding a new "active" field to the Friend GraphQL type that we can use to correct the problem.

@bernardd
Copy link

@toland is adding a new "active" field to the Friend GraphQL type that we can use to correct the problem.

Not yet he's not :) I'm going to talk to Pavel tonight (my time) and establish what exactly (if anything) is actually needed from the server because at this point it's not clear that the client doesn't have what it needs.

@aksonov aksonov self-assigned this Mar 13, 2020
aksonov added a commit that referenced this issue Mar 13, 2020
@aksonov
Copy link
Contributor

aksonov commented Mar 13, 2020

Okey, we talked with Bernard and agreed that 'share nearby' start event is not good mechanism to use, so I changed the app to use location property - so a user is 'active' while the server sends location for him. So it works better now, but I found two issues:

  1. when user A left nearby but B went to background before, A still be 'active' for B (the server still sends location even if A is not in B's range)

  2. 'nearby end' event is not sent for A when A is moving outside (it is sent only to B) - it is very similar to 'nearby start' event issue I've posted before

cc @toland @southerneer

@toland
Copy link
Contributor

toland commented Mar 13, 2020

@aksonov I've just merged some changes to the server that should address the two issues you mentioned. Those changes will be going to staging shortly.

@mstidham
Copy link
Author

mstidham commented Mar 13, 2020

Codepush Staging- Pavel "4905 - sharing nearby"
@aksonov I just tested the codepush and going to report my findings knowing that you are aware of them also.

Issue 1:
User A has the app open and leaves the nearby User B radius (works perfectly User B fades on header and disappears from map). User A then returns within radius and nothing happens (user does not dynamically show up on header or map). User does a kill/reload and then they appear.

Issue 2:
User A has the app in a killed state and leaves nearby radius of User B. User A opens the app outside of the radius and User B still displays sharing live location even though they are outside of the radius.

I'm also unable to get any push notifications to generate for nearby, when entering the radius.

@bengtan bengtan mentioned this issue Mar 16, 2020
aksonov added a commit that referenced this issue Mar 16, 2020
@mstidham
Copy link
Author

This is now working good for me after the server deploy.

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

6 participants