[FindMyDevice] FindMyDevice cannot connect to the device from the Website.

VERIFIED FIXED in Firefox OS master

Status

Firefox OS
FindMyDevice
VERIFIED FIXED
3 years ago
3 years ago

People

(Reporter: Marty, Assigned: kitcambridge)

Tracking

({regression})

unspecified
FxOS-S1 (26Jun)
ARM
Gonk (Firefox OS)
regression
Dependency tree / graph

Firefox Tracking Flags

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

Details

(Whiteboard: [3.0-Daily-Testing][spark])

Attachments

(6 attachments, 4 obsolete attachments)

(Reporter)

Description

3 years ago
Created attachment 8598312 [details]
logcat-FMD.txt

Description:
Once the user logs into a Firefox Account and enables Find My Device, the website find.firefox.com will not be able to connect to the device.  Signing in results in a 'Sorry but you don't have any devices." message on the website.

The user is further unable to disable Find My Device on the phone.  Toggling FMD to disable it results in the toggle switch being greyed out, without a password prompt.  Closing and reopening settings shows that FMD is still enabled.

Repro Steps:
1) Update a Flame to 20150427010202
2) Open the Settings app and navigate to Firefox Accounts
3) Log in to a new Firefox Account
4) Navigate to Find My Device in Settings and Enable it.
5) In a web browser on another device or computer, navigate to find.firefox.com and sign in to the same Firefox Account
6) On the DUT, attempt to disable Find My Device.

Actual:
The website is unable to connect to the Device, and Find My Device is not able to be disabled.

Expected:
The website properly connects to the device, and Find My Device is able to be disabled with the account password.

Environmental Variables:
Device: Flame 3.0 (319MB)(Full Flash)
Build ID: 20150427010202
Gaia: b4c949cdc780893897c9b45c1adea46e2eb694ff
Gecko: 37d60e3b8be6
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

Repro frequency: 10/10
See attached: Logcat
(Reporter)

Comment 1

3 years ago
This issue does NOT occur on Flame 2.2 builds.
The website properly connects to the device, and Find My Device is able to be disabled with the account password.

Device: Flame 2.2 (319mb)(Full Flash)
BuildID: 20150427002504
Gaia: 265ca0bc9408c21fc4b25a259fcee7fb642cd06b
Gecko: 1908685d798d
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
QA Whiteboard: [QAnalyst-Triage?]
Flags: needinfo?(pbylenga)
status-b2g-v2.1: --- → affected
[Blocking Requested - why for this release]:

This is busted functionality that is a regression. Nominating this 2.1?
blocking-b2g: --- → 2.1?
QA Whiteboard: [QAnalyst-Triage?] → [QAnalyst-Triage+]
Keywords: regressionwindow-wanted
QA Contact: jmercado
Flags: needinfo?(pbylenga)
Bug 1150683 seems to be the cause of this issue.

Mozilla-inbound Regression Window

Last Working 
Environmental Variables:
Device: Flame 3.0
BuildID: 20150421110500
Gaia: 0645bbed4d6cbd8064652eebafe011edc3e417fd
Gecko: 1023edc0a85e
Version: 40.0a1 (3.0) 
Firmware Version: v18D-1
User Agent: Mozilla/5.0 (Mobile; rv:40.0) Gecko/40.0 Firefox/40.0

First Broken 
Environmental Variables:
Device: Flame 3.0
BuildID: 20150421111200
Gaia: 0645bbed4d6cbd8064652eebafe011edc3e417fd
Gecko: a5eee04c796e
Version: 40.0a1 (3.0) 
Firmware Version: v18D-1
User Agent: Mozilla/5.0 (Mobile; rv:40.0) Gecko/40.0 Firefox/40.0

Last Working gaia / First Broken gecko - Issue DOES occur
Gaia: 0645bbed4d6cbd8064652eebafe011edc3e417fd
Gecko: a5eee04c796e

First Broken gaia / Last Working gecko - Issue does NOT occur
Gaia: 0645bbed4d6cbd8064652eebafe011edc3e417fd
Gecko: 1023edc0a85e

Gecko Pushlog: http://hg.mozilla.org/integration/mozilla-inbound/pushloghtml?fromchange=1023edc0a85e&tochange=a5eee04c796e
QA Whiteboard: [QAnalyst-Triage+] → [QAnalyst-Triage?]
Flags: needinfo?(ktucker)
Keywords: regressionwindow-wanted
Kit, can you take a look at this please? This might have been caused by the work done for bug 1150683.
Blocks: 1150683
QA Whiteboard: [QAnalyst-Triage?] → [QAnalyst-Triage+]
Flags: needinfo?(ktucker) → needinfo?(kcambridge)
Ouch. I think I see the problem...we moved the existing Simple Push implementation into `dom/simplepush`, and changed the launcher logic in bug 1153937...but didn't disable the new `dom/push` on B2G. Will investigate further and follow up with a fix.
Flags: needinfo?(kcambridge)
Created attachment 8599083 [details] [diff] [review]
0001-Bug-1159046-Update-Simple-Push-component-IDs.-r-nsm.patch

This changes the component and contract IDs for `dom/simplepush` to avoid conflicts with the new implementation on B2G.

`ServiceWorkerRegistrationMainThread::GetPushManager` relies on `@mozilla.org/push/PushManager;1`, and does very bad things™ if it finds `SimplePushManager` instead of the new `PushManager`.
Assignee: nobody → kcambridge
Status: NEW → ASSIGNED
Attachment #8599083 - Flags: review?(nsm.nikhil)
Created attachment 8599086 [details] [diff] [review]
0002-Bug-1159046-Gate-PushNotificationService-on-dom.push.patch

Reinstated `dom.push.enabled` because `dom/push` uses the same IDB store (see bug 1159573), and we don't have migration code in place yet.

Using the new Push API on B2G also causes timeout errors if `dom.push.connection.enabled` is false, or create a duplicate connection if it's true. I think we should keep it disabled there for now.
Attachment #8599086 - Flags: review?(dougt)
https://treeherder.mozilla.org/#/jobs?repo=try&revision=ec16b2b07476

I tested the patches in the emulator. With both applied, the device shows up on the site once FMD is enabled.
Why is this a 2.1 blocker when it is working on 2.2? (comment 1). The code that changed landed very recently and is not shipping until 3.0
Flags: needinfo?(ktucker)
[Blocking Requested - why for this release]:

I see your point on this since the window points to something that landed on master which caused this to regress. We can flip the nom to 3.0 and write a separate issue for 2.1 since this is broken functionality on that branch for a different reason.
blocking-b2g: 2.1? → 3.0?
Flags: needinfo?(ktucker)
status-b2g-v2.1: affected → ---
Comment on attachment 8599086 [details] [diff] [review]
0002-Bug-1159046-Gate-PushNotificationService-on-dom.push.patch

Review of attachment 8599086 [details] [diff] [review]:
-----------------------------------------------------------------

::: dom/push/PushNotificationService.js
@@ +41,5 @@
> +  _pushEnabled: function _pushEnabled() {
> +    return Services.prefs.getBoolPref("dom.push.enabled");
> +  },
> +
> +  _gate: function _gate(func) {

need a better name here. i don't know what a good name is, but i will know it when I see it.
Attachment #8599086 - Flags: review?(dougt) → review+
Whiteboard: [3.0-Daily-Testing] → [3.0-Daily-Testing][spark]
It seems I cannot add the blocking spark flag, but I am assuming this feature is important for the Spark program. It looks as if the patch has a review - can someone check it in so we can test this works for Spark?
Naoki, could you check that this fixes the issue?
blocking-b2g: 3.0? → spark+
Flags: needinfo?(nhirata.bugzilla)
Created attachment 8609100 [details]
logcat.txt

I applied the patch in a private repo and made a build for Aries; having said that I wasn't successful in connecting with the patch.

( I verified that I got the "right" gecko by checking the gecko version ).

Not sure if the issue with Aries is the same as the one for flame, come to think of it.  Attached is the logcat with the patch.
Since I have my build machine pointed to a central repo for moz-central, I can build a new gecko for flame with the same hg rev without too much adjustments.

Making a flame build and going to gather the logs for that.
Created attachment 8609113 [details]
flame-logcat.txt

Made a build for flame; flame fails to find as well.  Attached is the logcat for flame.

Passing the bug back to you, Kit.  Please needinfo me if you have a new patch to test or need more info.
Flags: needinfo?(nhirata.bugzilla) → needinfo?(kcambridge)
To note, geolocation does work on the device.  (ie going to maps.google.com points to the right location )
Thanks, Naoki. Looks like it works fine in the emulator, but doesn't launch at all on the device. Will investigate further.
Kit, do you have any updates on this? Thanks for any info you can provide.
Hi Doug. I just tracked this down...naming conflicts and forgotten manifest update. New patches incoming.
Flags: needinfo?(kcambridge)
Created attachment 8612646 [details] [diff] [review]
0001-Bug-1159046-Update-Simple-Push-component-IDs-and-pat.patch

* Renamed the existing `simplepush/Push*`-prefixed files to `simplepush/SimplePush*` to avoid `resource://gre/modules/Push*` import conflicts.
* Updated `b2g/installer/package-manifest.in`.
* Skip building and installing the new XPCOM interface on B2G, too.
Attachment #8599083 - Attachment is obsolete: true
Attachment #8612646 - Flags: review?(nsm.nikhil)
Created attachment 8612647 [details] [diff] [review]
0002-Bug-1159046-Gate-PushNotificationService-on-dom.push.patch

Carrying over r+; s/gate/ensureEnabled/g.
Attachment #8599086 - Attachment is obsolete: true
Attachment #8612647 - Flags: review+
Naoki, could you verify the new patches, please?
Flags: needinfo?(nhirata.bugzilla)
Sorry, was sick yesterday and I missed the ping on friday.  looking now.
Patch worked for flame.  Making a new build for aries...
Comment on attachment 8612646 [details] [diff] [review]
0001-Bug-1159046-Update-Simple-Push-component-IDs-and-pat.patch

Review of attachment 8612646 [details] [diff] [review]:
-----------------------------------------------------------------

::: dom/simplepush/SimplePush.manifest
@@ +2,5 @@
> +component {0b8e61bf-4ff8-41c9-8f9d-9a2f803cad78} SimplePush.js
> +contract @mozilla.org/simplepush/PushManager;1 {0b8e61bf-4ff8-41c9-8f9d-9a2f803cad78}
> +
> +# Component to initialize PushService on startup.
> +component {4b8caa3b-3c58-4f3c-a7f5-7bd9cb24c11d} SimplePushServiceLauncher.js

I'd bump every UUID in these files just to be safe.
Attachment #8612646 - Flags: review?(nsm.nikhil) → review+
(In reply to Nikhil Marathe [:nsm] (needinfo? please) from comment #27)
> I'd bump every UUID in these files just to be safe.

Bumped in the previous patch (attachment 8599083 [details] [diff] [review]); just didn't change the file names there.
To clarified when I said worked:
The website found the device, the phone rang and locked and erased.

Doing further testing on some other potential issues:
1) Once the phone was reset and the phone set up for find my device; however, the web browser from the desktop I used initially failed to connect.
2) reflashing the phone, find.firefox.com on the phone located the phone; I tried clearing the cache on the desktop browser and the phone was eventually found after a long wait.  I think 5 minutes?
3) tapping the power button works.
4) finding the device while the device is asleep doesn't seem to work; I tried waking the phone and then connecting and that didn't seem to work either. 

[note : doesn't work means not able to find the device on find.firefox.com ]

Tested on Aries:  I can't seem to log into firefox accounts at all?

How can I determine if all the servers for this service are up and running during the time of testing?

I'll have to retest with the changes to the patches.  I'll get a logcat as well with those changes.
Turns out that there's bug 1094759 that I have to avoid ( see bug 1172027 )
did a git reset --hard 85e6fcef45c0cb2c017739df42b68b96cf5bb9c3
Also these builds has the gecko patches + spark gaia:

https://drive.google.com/a/mozilla.com/folderview?id=0B_0LdM1CVycIfjJQbmcwaVctRWRmVC1uMm8wbF9lZWRBOXhsdXBlWmZsMU0xSnlLSkF5dnM&usp=sharing


gecko change log should be : 
changeset:   247469:47771cfeb8ed
tag:         0002-Bug-1159046-Gate-PushNotificationService-on-dom.push.patch
tag:         qtip
tag:         tip
user:        Kit Cambridge <kcambridge@mozilla.com>
date:        Fri Jun 05 17:13:02 2015 -0700
summary:     Bug 1159046 - Gate PushNotificationService on dom.push.enabled. r=d

changeset:   247468:766ed8526c3b
tag:         0001-Bug-1159046-Update-Simple-Push-component-IDs.-r-nsm.patch
tag:         qbase
user:        Kit Cambridge <kcambridge@mozilla.com>
date:        Fri Jun 05 17:13:02 2015 -0700
summary:     Bug 1159046 - Update Simple Push component IDs and paths. r=nsm

changeset:   247467:4a07e1ac3cdf
tag:         qparent
parent:      247438:49f13b251968
parent:      247466:163b199605d9
user:        Wes Kocher <wkocher@mozilla.com>
date:        Fri Jun 05 16:02:54 2015 -0700
summary:     Merge b2ginbound to central, a=merge

I ran into some weird issue where FMD still wasn't connecting, so I made a different build with the recent gecko/gaia as well.
QAWANTED : Delegating testing and getting logcat info based on comment 30 and comment 29.
Flags: needinfo?(nhirata.bugzilla)
Keywords: qawanted
QA Whiteboard: [QAnalyst-Triage+]
QA Contact: jmercado → pcheng
Created attachment 8620503 [details]
logcat - FMD loses tracking while sleeping

(In reply to Naoki Hirata :nhirata (please use needinfo instead of cc) from comment #29)
> Doing further testing on some other potential issues:
> 1) Once the phone was reset and the phone set up for find my device;
> however, the web browser from the desktop I used initially failed to connect.

I didn't have this issue after erasing the Flame from desktop browser FMD website. I used the 'avoid bug 1172027' build.

> 2) reflashing the phone, find.firefox.com on the phone located the phone; I
> tried clearing the cache on the desktop browser and the phone was eventually
> found after a long wait.  I think 5 minutes?

I didn't have this issue reflashing the 'avoid1172027' build. FMD website found my phone immediately.

> 3) tapping the power button works.

Is this for the purpose that the user can't power off the phone? I was able to power off the phone with FMD enabled. I wasn't aware of this feature though, since the user can still take out the battery to power off the phone.

> 4) finding the device while the device is asleep doesn't seem to work; I
> tried waking the phone and then connecting and that didn't seem to work
> either. 

This I can reproduce on the Flame with avoid1172027 build. If I let the phone sit and sleep for several minutes, the FMD website can no longer track my Flame. Waking and unlocking the phone sometimes resumes tracking, most of the times it does not resume tracking or it resumes for a minute and then loses again. I have uploaded a logcat for Flame losing FMD trace while it sleeps.

> Tested on Aries:  I can't seem to log into firefox accounts at all?

Tested with avoid1172027, I was able to log into firefox account, enable FMD, track, ring, and lock the device. Erasing the device doesn't seem to work though, when I send the erase command on desktop browser, the aries device screen turns off for a few seconds and doesn't seem to do anything else. But I think it's the build's problem, because it does the same thing if I go to Setting > Device Information > Reset Phone.

------

For fixing this bug I think this passes both Flame and Aries - I was able to enable and track my device, and I was able to turn FMD off.
QA Whiteboard: [QAnalyst-Triage?]
Flags: needinfo?(ktucker)
Keywords: qawanted
QA Whiteboard: [QAnalyst-Triage?] → [QAnalyst-Triage+]
Flags: needinfo?(ktucker)
On my device with an old profile, I'm still stuck with this. So far, debug shows that FMD calls Push API .register():
> 06-13 13:18:49.765  4121  4121 I Gecko   : -*- Push.js: register()

But then I have no trace of Push's .onsucces or .onerror callback being triggered.
Fernando, any idea why I'm having SimplePush not returning either onsuccess or onfailure?
Flags: needinfo?(frsela)
So far it looks like PushService.jsm never gives any sign of life ...
(In reply to Alexandre LISSY :gerard-majax from comment #35)
> So far it looks like PushService.jsm never gives any sign of life ...

And of course, I have prefs:
> services.push.enabled true
> services.push.debug true
Adding debug into PushServiceLauncher.js, it's not even triggered ...
If I do the same as PushServiceLauncher.js by hand with WebIDE connected on the main process,
> Cu.import("resource://gre/modules/PushService.jsm");
> PushService.init();

Then FindMyDevice works again !
Depends on: 1174420
Depends on: 1174422
Created attachment 8622017 [details] [diff] [review]
1159046.1.patch

Rebased; carrying forward r+.
Attachment #8612646 - Attachment is obsolete: true
Attachment #8622017 - Flags: review+
Created attachment 8622018 [details] [diff] [review]
1159046.2.patch

Rebased.
Attachment #8612647 - Attachment is obsolete: true
Attachment #8622018 - Flags: review+
Comment on attachment 8622017 [details] [diff] [review]
1159046.1.patch

Johnny, could I trouble you to review the contract ID change in `SimplePushManager.webidl`, please? As of bug 1038811, `@mozilla.org/push/PushManager;1` belongs to the new `PushManager`.
Attachment #8622017 - Flags: superreview?(jst)
Kit, I would suggest that we RESOLVED:FIXED this bug since bug 1174420 and bug 1174422 landed to fix this, and that you file a follow up for this renaming?
Flags: needinfo?(kcambridge)
Flags: needinfo?(frsela)
Pi Wei and Naoki, would you mind asserting that with bug 1174420 and bug 1174422 landed we have FMD working again properly ?

That's my experience locally, so I expect it should be also on your side. Then we can mark this as fixed.
Flags: needinfo?(pcheng)
Flags: needinfo?(nhirata.bugzilla)
Works for me on Aries:
Build ID               20150616020615
Gaia Revision          62ba52866f4e5ca9120dad5bfe62fc5df981dc39
Gaia Date              2015-06-15 19:09:24
Gecko Revision         https://hg.mozilla.org/mozilla-central/rev/ce863f9d8864
Gecko Version          41.0a1
Device Name            aries
Firmware(Release)      4.4.2
Firmware(Incremental)  eng.worker.20150612.053308
Firmware Date          Fri Jun 12 05:33:15 UTC 2015
Bootloader             s1

Leaving verifyme for further verification against Flame.
Status: ASSIGNED → RESOLVED
Last Resolved: 3 years ago
Flags: needinfo?(nhirata.bugzilla)
Keywords: verifyme
Resolution: --- → FIXED
This issue is verified fixed on Flame. FMD can be enabled on device and can be traced on website. Ring, lock, and erase worked correctly. FMD can also be disabled on device.

Device: Flame (KK, 319MB, full flashed)
BuildID: 20150617010205
Gaia: 6271f932e1e918a35ee89f54288bd13385143a71
Gecko: d7c148c84594
Gonk: a4f6f31d1fe213ac935ca8ede7d05e47324101a4
Version: 41.0a1 (3.0 Master) 
Firmware Version: v18D-1
User Agent: Mozilla/5.0 (Mobile; rv:41.0) Gecko/41.0 Firefox/41.0
Status: RESOLVED → VERIFIED
QA Whiteboard: [QAnalyst-Triage+] → [QAnalyst-Triage?]
status-b2g-master: affected → verified
Flags: needinfo?(pcheng) → needinfo?(ktucker)
Keywords: verifyme
QA Whiteboard: [QAnalyst-Triage?] → [QAnalyst-Triage+]
Flags: needinfo?(ktucker)
blocking-b2g: spark+ → 2.5+
status-b2g-v2.5: --- → verified
Target Milestone: --- → FxOS-S1 (26Jun)
Flags: needinfo?(kcambridge)
status-b2g-v2.5: verified → ---
Attachment #8622017 - Flags: superreview?(jst)
You need to log in before you can comment on or make changes to this bug.