Check if localId is already used before using it

RESOLVED FIXED in Firefox 26

Status

RESOLVED FIXED
5 years ago
3 years ago

People

(Reporter: marco, Assigned: marco)

Tracking

Trunk
Firefox 26
x86_64
Linux

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

5 years ago
Created attachment 793203 [details] [diff] [review]
localid_fix

To get a new localId, we're using a preference. This doesn't work well with the multiple profile model we have for desktop apps.
Attachment #793203 - Flags: review?(fabrice)
Can you give steps to reproduce the issue you're having? I can't tell if this is in the app profile or in the firefox profile, and what are the prefs in any of them.
(Assignee)

Comment 2

5 years ago
The Firefox profile and the webapps profiles are separated.

e.g. in Firefox, the preference could be 1000, in one of the installed webapps it could be 1.
If you install an app through Firefox, _nextLocalId returns 1001.
If you install an app through another app, _nextLocal returns 2. This localId=2 could be already used by another application.

So, we can't rely on a preference because it isn't guaranteed to be in a sane state.
That doesn't explain why you want to avoid collisions between the firefox profile and the app profile.

I don't think you should try to synchronize the localIds among profiles. They are an implementation detail due to how we identify apps in principals and data jars. What really matters is only the manifest url.
(Assignee)

Comment 4

5 years ago
(In reply to Fabrice Desré [:fabrice] from comment #3)
> That doesn't explain why you want to avoid collisions between the firefox
> profile and the app profile.

The apps installed through another app are still installed in the Firefox profile. So without this patch we'd end up with several apps installed with the same localId in the same profile.
(Assignee)

Comment 5

5 years ago
We should disable apps installation from the webapp runtime if we can't fix this.
Flags: needinfo?(fabrice)
Attachment #793203 - Flags: review?(fabrice) → review+
(Assignee)

Comment 6

5 years ago
Created attachment 803986 [details] [diff] [review]
localid_fix

Updated commit message.
Assignee: nobody → mcastelluccio
Attachment #793203 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #803986 - Flags: review+
(Assignee)

Updated

5 years ago
Flags: needinfo?(fabrice)
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/dc5a610965b0
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 26
Product: Firefox → Firefox Graveyard
You need to log in before you can comment on or make changes to this bug.