Closed Bug 659777 Opened 13 years ago Closed 13 years ago

Cannot access remote/desktop tabs: "Svc.Private is undefined"


(Firefox :: Sync, defect)

Not set



Tracking Status
firefox5 --- unaffected
firefox6 --- fixed
fennec 6+ ---


(Reporter: mbrubeck, Assigned: mbrubeck)



(Keywords: regression, Whiteboard: [verified in services])


(2 files)

Steps to reproduce:
1. Connect Fennec to a sync account.
2. Open the "Desktop" tab on the awesome screen.

Expected results: List of remote tabs is displayed.
Actual results: No remote tabs are displayed.

Console error: "Svc.Private is undefined" resource://services-sync/engines/tab.js Line 219

This is reproducible in both desktop and Android, in both Nightly (7.0a1) and Aurora (6.0a2).
Regression from bug 648364 - there is no private browsing service in Fennec, and Svc.Private no longer falls back on a dummy implementation.
Blocks: 648364
tracking-fennec: --- → ?
Blocks: 659689
Attached patch patchSplinter Review
The problem is that nsIPrivateBrowsingService is not implemented in Fennec, and Sync no longer falls back on a dummy implementation.  This patch modifies the Svc.Private getter to return undefined always (instead of throwing an exception the first time and returning undefined later), and checks the existence of Svc.Private before trying to use it.

Alternately, you could go back to using a dummy service for Svc.Private, or we could implement a dummy service in Fennec.
Attachment #535220 - Flags: review?(philipp)
Comment on attachment 535220 [details] [diff] [review]

>+XPCOMUtils.defineLazyGetter(Svc, "Private", function() {
>+  try {
>+    return Cc[";1"].getService(Ci["nsIPrivateBrowsingService"]);
>+  } catch (e) {
>+    return undefined;
>+  }

Please add a comment above this stanza to explain why we're doing this lazy getter the long way round.

Looks good otherwise. Please commit on services-central, not m-c. I can also land it for you if you prefer.
Attachment #535220 - Flags: review?(philipp) → review+
Matt, btw, do you think there's a way to unit test this? I want to make sure we only make mistakes once ;)

(We really need TPS (nee Crossweave) tests to run against an actual Fennec instance for the 'mobile' test run, then we would actually have caught this.)
Blocks: 639711

We can try to add some Fennec browser-chrome tests to catch sync bugs, until we are able to get the xpcshell tests running for mobile.
Flags: in-testsuite?
Whiteboard: [fixed in services]
Comment on attachment 535220 [details] [diff] [review]

Requesting approval-mozilla-aurora.  This is a regression compared to Firefox 5 that affects Firefox 6 and breaks major functionality in Fennec.  The fix is low risk and localized (adding a single try-catch block and null guards).

The alternate to this fix is to back out bug 648364 which was a large refactoring (over 1000 lines changed).  Since other changes to the code have landed on top of that refactoring, it probably cannot be backed out without manual conflict resolution.
Attachment #535220 - Flags: approval-mozilla-aurora?
Comment on attachment 535220 [details] [diff] [review]

Looks safe
Attachment #535220 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Pushed to Aurora for Firefox 6:

This is not yet fixed on trunk.  It will land in the next merge from services-central to mozilla-central.
Target Milestone: --- → Firefox 6
Component: General → Firefox Sync: Backend
Product: Fennec → Mozilla Services
QA Contact: general → sync-backend
Target Milestone: Firefox 6 → mozilla6
Version: Trunk → unspecified
Attached image screenshot
tracking-fennec: ? → 6+
STRs for QA: Tabs from Other Computers should work on Fennec again now (was briefly broken on Aurora and Nightlies).
WFM: Verified Fixed on Aurora

Mozilla/5.0 (Android; Linux armv7l; rv:6.0a2) Gecko/20110531 Firefox/6.0a2 Fennec/6.0a2
Whiteboard: [fixed in services] → [verified in services]
Closed: 13 years ago
Resolution: --- → FIXED
Verified fixed on Firefox 6 Beta 2: Mozilla /5.0 (Android;Linux armv7l;rv:6.0) Gecko/20110713 Firefox/6.0 Fennec/6.0

Device: LG Optimus 2X (Android 2.2)
Flags: in-testsuite?
Component: Firefox Sync: Backend → Sync
Product: Cloud Services → Firefox
You need to log in before you can comment on or make changes to this bug.