Find my device show 'unable to connect' notification and self disable when in Airplane mode

VERIFIED FIXED in 2.2 S9 (3apr)

Status

defect
VERIFIED FIXED
4 years ago
4 years ago

People

(Reporter: NicolasWeb, Assigned: gmarty)

Tracking

unspecified
2.2 S9 (3apr)

Firefox Tracking Flags

(blocking-b2g:2.2+, b2g-v2.2 verified, b2g-master verified)

Details

(Whiteboard: [systemsfe])

Attachments

(1 attachment)

(Reporter)

Description

4 years ago
User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:35.0) Gecko/20100101 Firefox/35.0
Build ID: 20150112203352

Steps to reproduce:

1. Enable FMD in settings
2. Disable wifi


Actual results:

A. After some times (late at night, near midnight), a notification comes saying "Connexion impossible. Tap to check settings"
B. FMD is disable in settings. If you enabled it again, it will show the error in a few seconds.


Expected results:

FMD shouldn't make errors without wifi.
(Reporter)

Comment 1

4 years ago
Expected result :
FMD shouldn't make error with airplane mode enabled : is FMD device trying to connect in airplane mode a feature by design (that I don't know : over passing the AirPlaneMode to find a device) or a bug (what I think) ?

Others scenarios to get the same error but with different step to reproduce :
Scenario A : Reproducible = not sure, happen once
go to comment #0

Scenario B : Reproducible = Always
1. Enable FMD
2. Disable wifi
3. Enable Air plane mode
(4. push button to switch off and lock screen) or wait 
5. Wait

Scenario C : Reproducible = Many (Always ???)
1. Enable FMD
2. Enable wifi
3. Wait a long time (a night)
4. Enable Air plane mode, you will get the error immediately

Scenario D : Reproducible = Once
1. Enable Wifi
2. Enable FMD
3. Enable Air Plane Mode + wait for a few
4. Disable Air Plane Mode
5. Disable wifi

Scenario E : Reproducible = Once
Same as 1, 2, 3 of scenario D
4. plug in cable between computer and phone : the screen turns on and then you get the notification
Summary: Find my device show 'unable to connect' notification when wifi is disabled → Find my device show 'unable to connect' notification and self disable when in Airplane mode

Comment 2

4 years ago
Hi,
same behaviour on a 2.2 build, activated FMD which was working fine.
One night I put an airplane mode, got the "Connexion impossible. Tap to check settings" message, and since then, FMD is greyed out. 
Reboot doesn't help.
(Reporter)

Comment 3

4 years ago
A way to fix the greyed out FMD setting is to logout and login from the Firefox account.
blocking-b2g: --- → 2.2?

Comment 4

4 years ago
Triage is blocking. This should not happen every time wifi is turned off and on.
blocking-b2g: 2.2? → 2.2+
Tarek, is it something that your team is working on? Thank you.
Flags: needinfo?(tarek)
Ian, is it something you could help? Thanks!
Flags: needinfo?(tarek) → needinfo?(ianb)
There's no one in our group working the Firefox OS portion of FMD (only server and find.firefox.com), but Alexandre Lissy may be able to help.
Flags: needinfo?(ianb) → needinfo?(lissyx+mozillians)
This is probably part of the tons of limitation I warned about when this landed. Since nobody has been working on it ...
Flags: needinfo?(lissyx+mozillians)
And I'm busy with a lot of totally unrelated and each urgent stuff. Would one of you guys have some time to look ?
Flags: needinfo?(mgoodwin)
Flags: needinfo?(guilherme.p.gonc+bmo)
Flags: needinfo?(6a68)
FYI I don't reproduce this on my Z3 Compact which runs master ...

Nicolas, can you enable "Gaia debug traces" in Developper settings, and reproduce while recording |adb logcat -v threadtime| ?
Flags: needinfo?(citizendruide)
I did reproduce, indeed.
And it's probably just the expected behavior of bug 1034570 where we decided to potentially warn too much the user if there are issues when we try to contact the server. The goal was to avoid letting think his device is under FMD control when it's not the case.
And in the case reproduced here (Enable FMD, enable Airplane mode), this is because we hit the "Push request error" code path: https://github.com/mozilla-b2g/gaia/blob/e358c1ba5782694eeb217436abbc00c310307859/apps/findmydevice/js/findmydevice.js#L323

So, push request failed 5 times in a row, we just disable and warn the user. That's the UX tradeoff we came up with when it was time to land this: we cannot let the user believe he has this feature enabled when it's not the case (because he may rely on it to find his stolen device after), and it was too late for UX and other stuff to rework everything.
It sounds like we should not be attempting to re-register while the device is offline/in airplane mode, so the notification will only appear when online. I believe that change in itself is reasonable and should be fairly easy to do, but I'd like to get UX input to see if that's really the behavior we want (versus, say, notifying the user somehow that FMD won't work offline). Jacqueline, any thoughts?
Flags: needinfo?(guilherme.p.gonc+bmo) → needinfo?(jsavory)
Flags: needinfo?(mgoodwin)
(Reporter)

Updated

4 years ago
Flags: needinfo?(citizendruide)
It might be good to ask QA to reproduce bugs like this before we zoom into investigating.

I'm working on totally unrelated stuff and can't help right now.
Flags: needinfo?(6a68)
I agree that we should not be showing this message when the device is offline, it would very irritating for the user who has put the device in airplane or offline mode. 

If the user has gone offline while registration is still ongoing, are we able to show the notification error once and then leave it up to the user to re-enable it later?
Flags: needinfo?(jsavory)
(Reporter)

Comment 18

4 years ago
> it would very irritating for the user who has put the device in
> airplane or offline mode. 

> are we
> able to show the notification error once and then leave it up to the user to

I can confirm that it is very irritating to have a random notification at 3 am (That's how I discovered this bug). So the moment when we notify to the user is important (when going online ? when waking-up the screen ?)
Guillaume, can you take a look here?
Flags: needinfo?(gmarty)
(Assignee)

Comment 20

4 years ago
I have a patch will notify the user only when the server is not accessible (= down) after x attempts. When the phone goes offline (because deactivated by the user or when there's no network), no notifications will be shown.

I hope that's OK, please comment if not.
Assignee: nobody → gmarty
Flags: needinfo?(gmarty)
(Assignee)

Comment 21

4 years ago
See the comment above and let me know if you have a better suggestion. Thanks!
Flags: needinfo?(mgoodwin)
Flags: needinfo?(lissyx+mozillians)
Flags: needinfo?(jsavory)
Flags: needinfo?(guilherme.p.gonc+bmo)
(In reply to Guillaume Marty [:gmarty] from comment #20)
> I have a patch will notify the user only when the server is not accessible
> (= down) after x attempts.

Note that we already do this (where x = 5 I believe). This bug is about ignoring failures while we're in airplane mode.

> When the phone goes offline (because deactivated by the user or when there's no network), no notifications will be shown.

That's almost the behavior we want, I believe. We do want to notify the user when the network fails, but we want to ignore the "failure" if it's because we're in airplane mode. :mgoodwin, :gerard-majax and I discussed this a bit on #wmf yesterday, and it looks like a good way to do it would be to return early from countRegistrationRetry()[1] if we're on airplane mode.

I believe :mgoodwin will be able to review your patch and help write tests for it, but I'll be happy to do it if he can't.

Thanks for taking this!

1- https://github.com/mozilla-b2g/gaia/blob/master/apps/findmydevice/js/findmydevice.js#L588
Flags: needinfo?(guilherme.p.gonc+bmo)
As long as we are sure we can distinguish legit failures from legit non available network, that works for me.
Flags: needinfo?(lissyx+mozillians)
Sorry about this one, I was under the impression that this had to do with the registration process. 

I agree that there should be no message to the user when they go offline as that could be very repetitive. If the server is down I also agree that after a few attempts we could disable FMD, send a notification of the error and allow them to try later. However this should not happen while offline or in airplane mode.
Flags: needinfo?(jsavory)
(Assignee)

Comment 26

4 years ago
Comment on attachment 8578038 [details] [review]
[gaia] gmarty:Bug-1124335-Find-my-device-show-unable-to-connect-notification-and-self-disable-when-in-Airplane-mode > mozilla-b2g:master

Here's a patch with a unit test.
Checking airplane mode only is not enough (the user can deactivate Wi-Fi and Data), so I'm using navigator.onLine.
Attachment #8578038 - Flags: review?(mgoodwin)
(Assignee)

Comment 27

4 years ago
Comment on attachment 8578038 [details] [review]
[gaia] gmarty:Bug-1124335-Find-my-device-show-unable-to-connect-notification-and-self-disable-when-in-Airplane-mode > mozilla-b2g:master

Doug, if you have time please review this patch.
Attachment #8578038 - Flags: review?(dougt)
Comment on attachment 8578038 [details] [review]
[gaia] gmarty:Bug-1124335-Find-my-device-show-unable-to-connect-notification-and-self-disable-when-in-Airplane-mode > mozilla-b2g:master

Looks good to me.
Flags: needinfo?(mgoodwin)
Attachment #8578038 - Flags: review?(mgoodwin)
Attachment #8578038 - Flags: review?(dougt)
Attachment #8578038 - Flags: review+
(Assignee)

Updated

4 years ago
Keywords: checkin-needed
Autolander could not locate a review from a user within the suggested reviewer list. Either the patch author or the reviewer should be in the suggested reviewer list.
Depends on: 1148396
Adding checkin-needed again as the suggested review list has been updated.
Keywords: checkin-needed
Status: UNCONFIRMED → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
(Assignee)

Comment 32

4 years ago
Comment on attachment 8578038 [details] [review]
[gaia] gmarty:Bug-1124335-Find-my-device-show-unable-to-connect-notification-and-self-disable-when-in-Airplane-mode > mozilla-b2g:master

[Approval Request Comment]
[Bug caused by] (feature/regressing bug #): Find my Device
[User impact] if declined: When offline, the user gets a notification that the server is not reachable. That's annoying when she put herself the phone in airplane mode.
[Testing completed]: Unit tested but manual testing is needed
[Risk to taking this patch] (and alternatives if risky): Risk is low. The change itself is minimal and is fully unit tested.
[String changes made]: None.
Attachment #8578038 - Flags: approval-gaia-v2.2?(bbajaj)
Keywords: verifyme
Attachment #8578038 - Flags: approval-gaia-v2.2?(bbajaj) → approval-gaia-v2.2+
Whiteboard: [systemsfe]
Peter, could you help verify this bug?
Flags: needinfo?(pbylenga)
Flags: needinfo?(pbylenga)
Keywords: qawanted
This issue seems to be fixed in the latest 3.0 and 2.2 builds.

Actual Results: The error message does not occur.

Issue DOES occur

Environmental Variables:
Device: Flame 3.0
BuildID: 20150210010523
Gaia: 0cf517083f7eb5fc269e1236edba50534f65e3cd
Gecko: 2cb22c058add
Gonk: b83fc73de7b64594cd74b33e498bf08332b5d87b
Version: 38.0a1 (3.0) 
Firmware Version: v18D-1
User Agent: Mozilla/5.0 (Mobile; rv:38.0) Gecko/38.0 Firefox/38.0

Issue does NOT occur

Environmental Variables:
Device: Flame 2.2
BuildID: 20150417002504
Gaia: d50b8a3919a7b4d8d289f150d3b9bed704ebafa9
Gecko: 5ebf32030512
Gonk: ebad7da532429a6f5efadc00bf6ad8a41288a429
Version: 37.0 (2.2) 
Firmware Version: v18D-1
User Agent: Mozilla/5.0 (Mobile; rv:37.0) Gecko/37.0 Firefox/37.0

Environmental Variables:
Device: Flame 3.0
BuildID: 20150417010203
Gaia: 3cd0a9facce26c2acc7be3755a17131a6358e33f
Gecko: 51e3cb11a258
Gonk: b83fc73de7b64594cd74b33e498bf08332b5d87b
Version: 40.0a1 (3.0) 
Firmware Version: v18D-1
User Agent: Mozilla/5.0 (Mobile; rv:40.0) Gecko/40.0 Firefox/40.0
Status: RESOLVED → VERIFIED
QA Whiteboard: [QAnalyst-Triage?]
Flags: needinfo?(ktucker)
Keywords: qawanted, verifyme
QA Whiteboard: [QAnalyst-Triage?] → [QAnalyst-Triage+]
Flags: needinfo?(ktucker)

Comment 36

4 years ago
I think I can still reproduce the issue: whenever I turn Find My Device on, after a while I receive the "Unable to connect" notification. Apparently, when this happens, Find My Device is turned off. I haven't figured out how to produce this behaveour exactly yet, nor whether Airplane Mode is involved. Anyway it happens really often and makes Find My Devices unreliable (and thus useless).

Build ID               20151022030554
Gaia Revision          29ce8ec8606e59f582375234440812b046346513
Gaia Date              2015-10-22 05:31:38
Gecko Revision         https://hg.mozilla.org/mozilla-central/rev/76bd0c01d72e64ca4f261ffdb2652a91f961e930
Gecko Version          44.0a1
Device Name            flame
Firmware(Release)      4.4.2
Firmware(Incremental)  eng.cltbld.20150527.043015
Firmware Date          Wed May 27 04:30:24 EDT 2015
Bootloader             L1TC000118D0
Enrico, because this bug as closed a long time ago, could you please file a separate bug and nominate for 2.5 ?

Thanks !
Flags: needinfo?(enrico.ghiorzi)
(In reply to enrico.ghiorzi from comment #36)
> I think I can still reproduce the issue: whenever I turn Find My Device on,
> after a while I receive the "Unable to connect" notification. Apparently,
> when this happens, Find My Device is turned off. I haven't figured out how
> to produce this behaveour exactly yet, nor whether Airplane Mode is
> involved. Anyway it happens really often and makes Find My Devices
> unreliable (and thus useless).

Have you checked logs? Have you checked there is no connectivity issue with FMD service? Maybe that's just a symptom of a legit issue?

Please do as julien suggested and make sure you provide comprehensive and full logs after enabling FMD and "Gaia debug" in Developper Settings.

Comment 39

4 years ago
(In reply to Julien Wajsberg [:julienw] from comment #37)
> Enrico, because this bug as closed a long time ago, could you please file a
> separate bug and nominate for 2.5 ?

I did that with bug 1217800, which in turn has been found to be essentially a duplicate of bug 1201128. Though, according to bug 1201128 comment 6, that won't be a blocker for 2.5.
Flags: needinfo?(enrico.ghiorzi)
You need to log in before you can comment on or make changes to this bug.