Closed Bug 907481 Opened 11 years ago Closed 11 years ago

Check if localId is already used before using it

Categories

(Firefox Graveyard :: Web Apps, defect)

x86_64
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 26

People

(Reporter: marco, Assigned: marco)

References

Details

Attachments

(1 file, 1 obsolete file)

Attached patch localid_fix (obsolete) — Splinter Review
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.
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.
(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.
We should disable apps installation from the webapp runtime if we can't fix this.
Flags: needinfo?(fabrice)
Attachment #793203 - Flags: review?(fabrice) → review+
Attached patch localid_fixSplinter Review
Updated commit message.
Assignee: nobody → mcastelluccio
Attachment #793203 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #803986 - Flags: review+
Flags: needinfo?(fabrice)
Keywords: checkin-needed
Status: ASSIGNED → RESOLVED
Closed: 11 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.

Attachment

General

Created:
Updated:
Size: