checkInstalled should check if the app is locally installed

RESOLVED FIXED in mozilla26

Status

RESOLVED FIXED
5 years ago
11 months ago

People

(Reporter: Pwnna, Assigned: marco)

Tracking

Trunk
mozilla26
Bug Flags:
in-testsuite ?

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Reporter)

Description

5 years ago
Steps to reproduce:
 
 1. Install a webapp
 2. Uninstall it by finding its executable and call it with -remove
 3. Reinstall the webapp < here it will fail and give you different error messages depending on the platform.

This has been tested on linux and mac.

Workaround:

If you only have one web app, you could uninstall via the browser console with the script

var r = navigator.mozApps.mgmt.getAll(); 
r.onsuccess = function() { navigator.mozApps.mgmt.uninstall(r.result[0]); }

Might have to play with that though.
(Assignee)

Comment 1

5 years ago
(In reply to Shuhao Wu [:Pwnna] from comment #0)
> Steps to reproduce:

I can't reproduce. Is there a particular application that shows this behaviour?
(Assignee)

Updated

5 years ago
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → INCOMPLETE
(Assignee)

Updated

5 years ago
Flags: needinfo?(shwu)
(Assignee)

Comment 2

5 years ago
(In reply to Shuhao Wu [:Pwnna] from comment #0)
> This has been tested on linux and mac.

(Note that on Mac there isn't a "remove" cmdline option)
(Reporter)

Comment 3

5 years ago
Does not work still.

Installed app from http://osumo.paas.allizom.org/install. Uninstalled at:

[~/.offlinemozillasupport-9222bf00162f8a5a4be38ead9851192d]$ ./webapprt-stub -remove

Notification says it is removed. The icon goes away from system menu. Go back to the site to find the install button disappear (that button disappear if it detects user already installed the app). You can also find the app in navigator.mozApps.
Flags: needinfo?(shwu)
(Reporter)

Updated

5 years ago
Status: RESOLVED → REOPENED
Resolution: INCOMPLETE → ---
(Assignee)

Comment 4

5 years ago
The app is actually uninstalled cleanly, the problem here is in checkInstalled that doesn't check if the app is locally installed.
OS: Linux → All
Hardware: x86_64 → All
Summary: Uninstalling webapp via -remove does not remove cleanly, which causes reinstall to fail → checkInstall should check if the app is locally installed
(Assignee)

Comment 5

5 years ago
Created attachment 785493 [details] [diff] [review]
checkInstalled_isLaunchable
Assignee: nobody → mcastelluccio
Status: REOPENED → ASSIGNED
Attachment #785493 - Flags: review?(fabrice)

Updated

5 years ago
Component: Web Apps → DOM: Apps
Product: Firefox → Core
Version: unspecified → Trunk
(Assignee)

Updated

5 years ago
Summary: checkInstall should check if the app is locally installed → checkInstalled should check if the app is locally installed
Comment on attachment 785493 [details] [diff] [review]
checkInstalled_isLaunchable

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

Does that mean that the main registry is not updated? Doesn't that prevent reinstalling the same app?
Attachment #785493 - Flags: review?(fabrice)
(Assignee)

Comment 7

5 years ago
(In reply to Fabrice Desré [:fabrice] from comment #6)
> Comment on attachment 785493 [details] [diff] [review]
> checkInstalled_isLaunchable
> 
> Review of attachment 785493 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> Does that mean that the main registry is not updated? Doesn't that prevent
> reinstalling the same app?

Yes, the main registry isn't updated. It's always the problem that the registry isn't in sync with applications installed, so we need to check if apps are actually installed with isLaunchable.
You did not answer my second question... Also, I would really prefer us to fix the registry update properly.
(Assignee)

Comment 9

5 years ago
(In reply to Fabrice Desré [:fabrice] from comment #8)
> You did not answer my second question...

Sorry, I should've been more clear. We always check if the app is locally installed, so an app can be installed if it is in the registry but isn't locally installed.

> Also, I would really prefer us to fix the registry update properly.

I agree, I'd like to have the apps in sync too, but it's a long term task and probably not feasible on all the platforms (on Mac we'll probably need to call something similar to _isLaunchable anyway).

I think, as all the other mozApps API calls are working correctly, for consistency we should make also checkInstalled work correctly.
(Assignee)

Updated

5 years ago
Attachment #785493 - Flags: review?(fabrice)
Attachment #785493 - Flags: review?(fabrice) → review+
(Assignee)

Comment 10

5 years ago
Created attachment 803984 [details] [diff] [review]
checkInstalled_isLaunchable

Updated commit message.
Attachment #785493 - Attachment is obsolete: true
Attachment #803984 - Flags: review+
(Assignee)

Updated

5 years ago
Keywords: checkin-needed
https://hg.mozilla.org/integration/b2g-inbound/rev/7b018235edc0

Could/should this have a test?
Flags: in-testsuite?
Keywords: checkin-needed
Nevermind, I was being dumb. This wasn't the bug at fault. Re-landed.
https://hg.mozilla.org/integration/b2g-inbound/rev/2981946d58f4
(Assignee)

Comment 14

5 years ago
(In reply to Ryan VanderMeulen [:RyanVM UTC-4] from comment #11)
> https://hg.mozilla.org/integration/b2g-inbound/rev/7b018235edc0
> 
> Could/should this have a test?

We could add a small test to test_install_app.xul. I've written the patch, I'm waiting for try results.
Should I open a new bug for that? Or is it better to land the test here too?
(Assignee)

Comment 15

5 years ago
Opened bug 916355.
https://hg.mozilla.org/mozilla-central/rev/2981946d58f4
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla26

Updated

11 months ago
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.