Closed
Bug 826357
Opened 12 years ago
Closed 12 years ago
Generate Metro-aware Sync client name
Categories
(Firefox for Metro Graveyard :: Sync, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
Firefox 23
People
(Reporter: rnewman, Assigned: jimm)
References
Details
(Whiteboard: [metro-mvp] [LOE:1] [sync:metro] feature=work)
Attachments
(1 file, 2 obsolete files)
|
3.10 KB,
patch
|
rnewman
:
review+
|
Details | Diff | Splinter Review |
Using Sync as the channel for communication between two Windows profiles will result in two Sync clients being present in the Sync 'constellation'.
Under the current logic, these will have the same name, which is really confusing, and will hit Bug 670474 and Bug 618509.
On Metro, device names should include some meaningful disambiguation, e.g., "Richard's Firefox on Surface Pro (Classic)".
See also Bug 679272.
Comment 1•12 years ago
|
||
This is a problem even without the extra automatic Metro sync setup stuff we've been talking about right?
| Reporter | ||
Comment 2•12 years ago
|
||
(In reply to Brian R. Bondy [:bbondy] from comment #1)
> This is a problem even without the extra automatic Metro sync setup stuff
> we've been talking about right?
It's a problem in any situation where there are two clients on devices with the same name and/or type, but you're going to hit it 100% of the time, and in an automated situation, perhaps where Metro doesn't have UI to rename the Sync client.
Updated•12 years ago
|
Whiteboard: [sync:metro] → [sync:metro][metro-mvp][LOE:1]
Updated•12 years ago
|
Whiteboard: [sync:metro][metro-mvp][LOE:1] → [metro-mvp] [LOE:1] [sync:metro]
Updated•12 years ago
|
Whiteboard: [metro-mvp] [LOE:1] [sync:metro] → [metro-mvp] [LOE:1] [sync:metro] feature=work
Updated•12 years ago
|
No longer blocks: metro-sync
| Assignee | ||
Comment 4•12 years ago
|
||
This looks a lot nicer than the current set up we have. On my system I get strings like:
jim's Metro Firefox on Monolith (metro)
jim's Nightly on Monolith (desktop)
where 'Monolith' is the machine name I've given my surface pro. Windows forces users to select this on initial sign in, so people should know it. The only time this name might be unrecognizable is in corporate environments, but I think most corp users are going to know their workstation name.
Assignee: nobody → jmathies
Attachment #744156 -
Flags: review?(rnewman)
| Reporter | ||
Comment 5•12 years ago
|
||
Comment on attachment 744156 [details] [diff] [review]
patch
Review of attachment 744156 [details] [diff] [review]:
-----------------------------------------------------------------
Please test this on a desktop build!
::: services/sync/modules/engines/clients.js
@@ +89,4 @@
>
> + let syncStrings = new StringBundle("chrome://browser/locale/sync.properties");
> + // bob's Metro Firefox on somedevice
> + let appName = syncStrings.get("sync.defaultAccountApplication");
This will throw on desktop. (I think desktop puts this file in chrome://weave/locale/services/sync.properties.)
--
[10:12:34.489] syncStrings.get("sync.defaultAccountApplication");
[10:12:34.491] [Exception... "Component returned failure code: 0x80520012 (NS_ERROR_FILE_NOT_FOUND) [nsIStringBundle.GetStringFromName]" nsresult: "0x80520012 (NS_ERROR_FILE_NOT_FOUND)" location: "JS frame :: resource://gre/modules/services-common/stringbundle.js :: <TOP_LEVEL> :: line 97" data: no]
Please either fix that distinction, or wrap this in a try block.
It also seems to just fail for me if the string doesn't exist:
[10:17:18.476] [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIStringBundle.GetStringFromName]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: resource://gre/modules/services-common/stringbundle.js :: <TOP_LEVEL> :: line 97" data: no]
so definitely be more defensive here.
@@ +89,5 @@
>
> + let syncStrings = new StringBundle("chrome://browser/locale/sync.properties");
> + // bob's Metro Firefox on somedevice
> + let appName = syncStrings.get("sync.defaultAccountApplication");
> + if (!appName.length) {
Empty strings are falsy in JS, and this will blow up if appName is null, so:
if (appName) {
is better in every way.
Attachment #744156 -
Flags: review?(rnewman) → feedback+
| Assignee | ||
Comment 6•12 years ago
|
||
(In reply to Richard Newman [:rnewman] from comment #5)
> Comment on attachment 744156 [details] [diff] [review]
> patch
>
> Review of attachment 744156 [details] [diff] [review]:
> -----------------------------------------------------------------
>
> Please test this on a desktop build!
>
> ::: services/sync/modules/engines/clients.js
> @@ +89,4 @@
> >
> > + let syncStrings = new StringBundle("chrome://browser/locale/sync.properties");
> > + // bob's Metro Firefox on somedevice
> > + let appName = syncStrings.get("sync.defaultAccountApplication");
>
> This will throw on desktop. (I think desktop puts this file in
> chrome://weave/locale/services/sync.properties.)
Ok, np. I was expecting a missing bundle / empty result result on desktop, so I think a try block here is the best route.
| Assignee | ||
Comment 7•12 years ago
|
||
* "result string"
| Assignee | ||
Comment 8•12 years ago
|
||
Attachment #744156 -
Attachment is obsolete: true
| Assignee | ||
Comment 9•12 years ago
|
||
Comment on attachment 745302 [details] [diff] [review]
patch
tested on desktop, works as expected.
Attachment #745302 -
Flags: review?(rnewman)
| Reporter | ||
Comment 10•12 years ago
|
||
Comment on attachment 745302 [details] [diff] [review]
patch
Review of attachment 745302 [details] [diff] [review]:
-----------------------------------------------------------------
r+ with nits, but I recommend you use the appropriate definition instead of hard-coding "Firefox" prior to this reaching Aurora.
::: browser/metro/locales/en-US/chrome/sync.properties
@@ +6,5 @@
>
> +# LOCALIZATION NOTE: Used in the default machine description when a new account
> +# is being set up. Should be unique to Metro, so that it does not conflict
> +# with Desktop. See /services/sync/modules/engines/clients.js getLocalName.
> +sync.defaultAccountApplication=Metro Firefox
Shouldn't this involve brandShortName ("Firefox", "Aurora")?
::: services/sync/modules/engines/clients.js
@@ +89,2 @@
>
> + let appName = ""
Trailing semicolon, and you can omit the initialization.
@@ +96,2 @@
>
> + if (!appName.length) {
Just
if (!appName) {
Attachment #745302 -
Flags: review?(rnewman) → review+
| Assignee | ||
Comment 11•12 years ago
|
||
(In reply to Richard Newman [:rnewman] from comment #10)
> > +# LOCALIZATION NOTE: Used in the default machine description when a new account
> > +# is being set up. Should be unique to Metro, so that it does not conflict
> > +# with Desktop. See /services/sync/modules/engines/clients.js getLocalName.
> > +sync.defaultAccountApplication=Metro Firefox
>
> Shouldn't this involve brandShortName ("Firefox", "Aurora")?
Well then it would match the other generated string used by desktop and defeat the purpose of this bug. So I was trying to use something that would be unique to the immersive browser.
| Reporter | ||
Comment 12•12 years ago
|
||
(In reply to Jim Mathies [:jimm] from comment #11)
> > > +sync.defaultAccountApplication=Metro Firefox
> >
> > Shouldn't this involve brandShortName ("Firefox", "Aurora")?
>
> Well then it would match the other generated string used by desktop and
> defeat the purpose of this bug. So I was trying to use something that would
> be unique to the immersive browser.
"Involve", not "be" -- that is, I would be expecting "Metro Nightly".
(And regardless, we really shouldn't be hard-coding the "Firefox" string anywhere except in official branding files.)
Status: NEW → ASSIGNED
| Assignee | ||
Comment 13•12 years ago
|
||
Updated. Also swapped out 'Metro' for 'Modern'.
So in metro land:
"jim's Modern Aurora on Monolith"
and on desktop:
"jim's Aurora on Monolith"
Attachment #745302 -
Attachment is obsolete: true
Attachment #745811 -
Flags: review?(rnewman)
| Reporter | ||
Comment 14•12 years ago
|
||
Comment on attachment 745811 [details] [diff] [review]
name v.2
Review of attachment 745811 [details] [diff] [review]:
-----------------------------------------------------------------
::: services/sync/modules/engines/clients.js
@@ +93,5 @@
> + try {
> + let syncStrings = new StringBundle("chrome://browser/locale/sync.properties");
> + appName = syncStrings.getFormattedString("sync.defaultAccountApplication", [brandName]);
> + } catch (ex) {}
> + appName = !appName ? brandName : appName;
appName = appName || brandName;
Attachment #745811 -
Flags: review?(rnewman) → review+
Comment 15•12 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 23
Updated•11 years ago
|
OS: Windows 8 Metro → Windows 8.1
You need to log in
before you can comment on or make changes to this bug.
Description
•