New issue
Advanced search Search tips

Issue 713655 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Closed: Nov 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: Bug



Sign in to add a comment

WebAPK gets installed again even after uninstalling it(when SW.js gets updated in the background)

Reported by nagaraju...@gmail.com, Apr 20 2017

Issue description

Steps to reproduce the problem:
1. Open any pre installed webAPK. Make sure this webAPK is due for updating SW.js and initiated the same in background.
2. While in the background SW.js is updating, uninstall the webAPK.
3. Within few moments, webAPK reappears on the screen with a notification from. Playstore saying app has been updated

What is the expected behavior?
webAPK should not get reinstalled once user uninstalled it.

What went wrong?
I believe, while SW.js gets updated in the background to re build new webAPK it's not listening to current uninstall (wild guess - not sure how the whole flow works) 

Did this work before? N/A 

Chrome version: 60.0.3074.0  Channel: canary
OS Version: 7.1.1
Flash Version:
 
Components: Mobile>WebAPKs

Comment 2 by hanxi@chromium.org, Apr 25 2017

Owner: hanxi@chromium.org
Status: Assigned (was: Unconfirmed)
Thanks for filing this bug. WebAPK uses a Chrome's activity (WebApkActivity), so when uninstall happens, it doesn't kill the WebApkActivity. You can still see it in recents and can bring it to foreground. I guess there is a pending update request, and we will only send it when the WebApkActivity onStop() is called. We should check whether the package still exists before sending a update request.

Comment 3 by hanxi@chromium.org, Apr 25 2017

Cc: dominickn@chromium.org pkotw...@chromium.org yfried...@chromium.org
It seems that check isn't enough. The way that I reproduce it is:
1. Navigate Chrome to https://webapk-test.appspot.com. Choose "upadatable", and add something like "1234" to the name in the Update part.
2. Install the WebAPK from Chrome.
3. Go back to Chrome, and clicks "update" in the above URL.
4. Launch the installed WebAPK.
5. Click the "home" button on the screen, so the WebAPK becomes invisiable.
6. Uninstall the WebAPK.

You will still see the Play install notification. This is because in step 5, onStope is called. At that point, the WebAPK is still installed, so the check is passed and the update request starts. The uninstall happens after the update request is sent, so we can't stop Play from completing the updating. I am not sure whether sending the request in onDestroy() would be a good idea. The pros: it can postpone the check to when the activity is swiped by user, and it most likely the uninstall has already happened; the cons is: we don't get enough chance to update a WebAPK. Thoughts?
Could this be fixed on the Phonesky side by do the update as part of a delayed task?

Comment 5 by hanxi@chromium.org, Apr 25 2017

Cc: hartma...@chromium.org
That is a good point. I think it depends on whether Phonesky knows whether the request is for update or install. From client side, we don't pass any specific data to distinguish the request. I guess DFE doesn't know neither.

+hartmanng@.
Copied  issue chromium:713655  to issue chromium:715168
"Copied  issue chromium:713655  to issue chromium:715168" Does this mean, further updates are not going be recorded in this issue?
> "Copied  issue chromium:713655  to issue chromium:715168" Does this mean, further updates are not going be recorded in this issue?

I needed a place to discuss some server-side implementation details which are, unfortunately, not publishable.

We will continue updating this issue with any non-confidential discussion.
Sure. Thank you for the update.
Project Member

Comment 10 by bugdroid1@chromium.org, Jun 13 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/1da39ba92b277ea834d61e6fb00d32177a472ebd

commit 1da39ba92b277ea834d61e6fb00d32177a472ebd
Author: pkotwicz <pkotwicz@chromium.org>
Date: Tue Jun 13 23:16:51 2017

Simplify WebAPK proto building code

This CL:
- Consolidates the WebAPK proto building in BuildProtoInBackground().
- Adds a BuildProto() method and makes callers use it instead of calling
  BuildWebApkProtoInBackground() directly.

BUG= 713655 

Review-Url: https://codereview.chromium.org/2932593005
Cr-Commit-Position: refs/heads/master@{#479199}

[modify] https://crrev.com/1da39ba92b277ea834d61e6fb00d32177a472ebd/chrome/browser/android/webapk/webapk_installer.cc
[modify] https://crrev.com/1da39ba92b277ea834d61e6fb00d32177a472ebd/chrome/browser/android/webapk/webapk_installer.h
[modify] https://crrev.com/1da39ba92b277ea834d61e6fb00d32177a472ebd/chrome/browser/android/webapk/webapk_installer_unittest.cc

Project Member

Comment 11 by bugdroid1@chromium.org, Jun 17 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/9940e1d1afe38894e862a18d605b1a64ecb4c2c2

commit 9940e1d1afe38894e862a18d605b1a64ecb4c2c2
Author: pkotwicz <pkotwicz@chromium.org>
Date: Sat Jun 17 00:55:42 2017

[Android WebAPK] Change WebAPK update into two phases

This CL splits WebAPK updates into two phases:
Phase #1: Compute the proto to send to the WebAPK Minting Server
Phase #2: Send the proto to send to the WebAPK Minting Server and talk to
Google Play

Phase #1 puts the data needed to do an update into an easily serializable
format. This enables a follow up CL to put the output of Phase #1 into a
org.chromium.components.background_task_scheduler.TaskInfo os.Bundle for use
with BackgroundTaskScheduler

BUG= 713655 

Review-Url: https://codereview.chromium.org/2933783002
Cr-Commit-Position: refs/heads/master@{#480255}

[modify] https://crrev.com/9940e1d1afe38894e862a18d605b1a64ecb4c2c2/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebApkUpdateManager.java
[modify] https://crrev.com/9940e1d1afe38894e862a18d605b1a64ecb4c2c2/chrome/android/javatests/src/org/chromium/chrome/browser/webapps/WebApkUpdateManagerTest.java
[modify] https://crrev.com/9940e1d1afe38894e862a18d605b1a64ecb4c2c2/chrome/android/junit/src/org/chromium/chrome/browser/webapps/WebApkUpdateManagerTest.java
[modify] https://crrev.com/9940e1d1afe38894e862a18d605b1a64ecb4c2c2/chrome/browser/android/webapk/webapk_install_service.cc
[modify] https://crrev.com/9940e1d1afe38894e862a18d605b1a64ecb4c2c2/chrome/browser/android/webapk/webapk_install_service.h
[modify] https://crrev.com/9940e1d1afe38894e862a18d605b1a64ecb4c2c2/chrome/browser/android/webapk/webapk_installer.cc
[modify] https://crrev.com/9940e1d1afe38894e862a18d605b1a64ecb4c2c2/chrome/browser/android/webapk/webapk_installer.h
[modify] https://crrev.com/9940e1d1afe38894e862a18d605b1a64ecb4c2c2/chrome/browser/android/webapk/webapk_installer_unittest.cc
[modify] https://crrev.com/9940e1d1afe38894e862a18d605b1a64ecb4c2c2/chrome/browser/android/webapk/webapk_update_manager.cc
[modify] https://crrev.com/9940e1d1afe38894e862a18d605b1a64ecb4c2c2/chrome/browser/android/webapk/webapk_update_manager.h

Owner: pkotw...@chromium.org
Peter's been working on this
Project Member

Comment 13 by bugdroid1@chromium.org, Jul 7 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/36758560e485bfee7d7c5d6b10300e77038fb415

commit 36758560e485bfee7d7c5d6b10300e77038fb415
Author: pkotwicz <pkotwicz@chromium.org>
Date: Fri Jul 07 23:44:30 2017

[Android] Remove unnecessary null check in WebappDirectoryManager#findStaleWebappDirectories()

The check is no longer necessary after https://codereview.chromium.org/1354323003

BUG= 713655 

Review-Url: https://codereview.chromium.org/2973103003
Cr-Commit-Position: refs/heads/master@{#485103}

[modify] https://crrev.com/36758560e485bfee7d7c5d6b10300e77038fb415/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappDirectoryManager.java

Project Member

Comment 14 by bugdroid1@chromium.org, Sep 5 2017

The following revision refers to this bug:
  https://chrome-internal.googlesource.com/clank/internal/apps/+/25b9afe78277feca07bf61c160067df5120480c1

commit 25b9afe78277feca07bf61c160067df5120480c1
Author: Peter Kotwicz <pkotwicz@chromium.org>
Date: Tue Sep 05 22:39:31 2017

Project Member

Comment 15 by bugdroid1@chromium.org, Sep 6 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/8cfc2b4786a07184e0959d3ed0b628c83051468c

commit 8cfc2b4786a07184e0959d3ed0b628c83051468c
Author: Peter Kotwicz <pkotwicz@chromium.org>
Date: Wed Sep 06 15:27:24 2017

Android WebAPK: Remove URL parameter from WebApkInstaller API part 2/3

Google Play no longer needs the URL parameter. The URL parameter used to be
used in the notification displayed by Google Play while the WebAPK was being
installed. Google Play no longer displays a notification while a WebAPK is
being installed.

BUG= 713655 

Change-Id: I1e60fc47dd09a971526791ac9be3bd728a04768a
Reviewed-on: https://chromium-review.googlesource.com/647876
Commit-Queue: Peter Kotwicz <pkotwicz@chromium.org>
Reviewed-by: Yaron Friedman <yfriedman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#499965}
[modify] https://crrev.com/8cfc2b4786a07184e0959d3ed0b628c83051468c/chrome/android/java/src/org/chromium/chrome/browser/webapps/GooglePlayWebApkInstallDelegate.java
[modify] https://crrev.com/8cfc2b4786a07184e0959d3ed0b628c83051468c/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebApkInstaller.java
[modify] https://crrev.com/8cfc2b4786a07184e0959d3ed0b628c83051468c/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebApkUpdateManager.java
[modify] https://crrev.com/8cfc2b4786a07184e0959d3ed0b628c83051468c/chrome/browser/android/webapk/webapk_install_service.cc
[modify] https://crrev.com/8cfc2b4786a07184e0959d3ed0b628c83051468c/chrome/browser/android/webapk/webapk_install_service.h
[modify] https://crrev.com/8cfc2b4786a07184e0959d3ed0b628c83051468c/chrome/browser/android/webapk/webapk_installer.cc
[modify] https://crrev.com/8cfc2b4786a07184e0959d3ed0b628c83051468c/chrome/browser/android/webapk/webapk_installer.h
[modify] https://crrev.com/8cfc2b4786a07184e0959d3ed0b628c83051468c/chrome/browser/android/webapk/webapk_installer_unittest.cc
[modify] https://crrev.com/8cfc2b4786a07184e0959d3ed0b628c83051468c/chrome/browser/android/webapk/webapk_update_manager.cc

Project Member

Comment 16 by bugdroid1@chromium.org, Sep 8 2017

The following revision refers to this bug:
  https://chrome-internal.googlesource.com/clank/internal/apps/+/f136ea6c1df82ed73cca85300733714acec6f025

commit f136ea6c1df82ed73cca85300733714acec6f025
Author: Peter Kotwicz <pkotwicz@chromium.org>
Date: Fri Sep 08 02:10:29 2017

Project Member

Comment 17 by bugdroid1@chromium.org, Sep 12 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/1b9d05b5b55eea66084b2ef5e7a437ebbb974a5d

commit 1b9d05b5b55eea66084b2ef5e7a437ebbb974a5d
Author: Peter Kotwicz <pkotwicz@chromium.org>
Date: Tue Sep 12 21:47:41 2017

Remove unused BackgroundUpdateManager class

Bug= 713655 

Change-Id: I0f5d91caf5568bfd2048c4895b45c9ab58067380
Reviewed-on: https://chromium-review.googlesource.com/651549
Commit-Queue: Peter Kotwicz <pkotwicz@chromium.org>
Reviewed-by: Yaron Friedman <yfriedman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#501409}
[modify] https://crrev.com/1b9d05b5b55eea66084b2ef5e7a437ebbb974a5d/chrome/browser/BUILD.gn
[modify] https://crrev.com/1b9d05b5b55eea66084b2ef5e7a437ebbb974a5d/chrome/browser/android/webapk/webapk_update_manager.cc
[delete] https://crrev.com/91bc11dbff1137892e5cd5a349df2a6cf702b890/chrome/browser/android/webapk/webapk_update_manager.h

Project Member

Comment 18 by bugdroid1@chromium.org, Oct 4 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/bfbb56d2c317ff8e1def9d22e6753d942d15a20e

commit bfbb56d2c317ff8e1def9d22e6753d942d15a20e
Author: Peter Kotwicz <pkotwicz@chromium.org>
Date: Wed Oct 04 18:24:20 2017

[Android WebAPK] Store WebAPK update data to disk

This CL makes WebApkUpdateManager store the "WebAPK update request" to disk and
retrieve it from disk once the WebApkActivity is ready to do the update (Once
the WebApkActivity is in the background). This CL is in preparation for
https://codereview.chromium.org/2948713002/ The "WebAPK update request" cannot
be encoded as an extra on com.google.android.gms.gcm.Task#setExtras() because
GCMNetworkManager limits the total size of the extras to 10KB. We might send up
to two PNG images as part of an update request

BUG= 713655 

Change-Id: I9d86eb8ffe4f650340028ec6c4d12a7b8ddc1aec
Reviewed-on: https://chromium-review.googlesource.com/581231
Commit-Queue: Peter Kotwicz <pkotwicz@chromium.org>
Reviewed-by: Tommy Nyquist <nyquist@chromium.org>
Reviewed-by: Dominick Ng <dominickn@chromium.org>
Cr-Commit-Position: refs/heads/master@{#506451}
[modify] https://crrev.com/bfbb56d2c317ff8e1def9d22e6753d942d15a20e/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebApkUpdateManager.java
[modify] https://crrev.com/bfbb56d2c317ff8e1def9d22e6753d942d15a20e/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappDataStorage.java
[modify] https://crrev.com/bfbb56d2c317ff8e1def9d22e6753d942d15a20e/chrome/android/javatests/src/org/chromium/chrome/browser/webapps/WebApkUpdateManagerTest.java
[modify] https://crrev.com/bfbb56d2c317ff8e1def9d22e6753d942d15a20e/chrome/android/junit/src/org/chromium/chrome/browser/webapps/WebApkUpdateManagerTest.java
[modify] https://crrev.com/bfbb56d2c317ff8e1def9d22e6753d942d15a20e/chrome/browser/android/webapk/webapk_install_service.cc
[modify] https://crrev.com/bfbb56d2c317ff8e1def9d22e6753d942d15a20e/chrome/browser/android/webapk/webapk_install_service.h
[modify] https://crrev.com/bfbb56d2c317ff8e1def9d22e6753d942d15a20e/chrome/browser/android/webapk/webapk_installer.cc
[modify] https://crrev.com/bfbb56d2c317ff8e1def9d22e6753d942d15a20e/chrome/browser/android/webapk/webapk_installer.h
[modify] https://crrev.com/bfbb56d2c317ff8e1def9d22e6753d942d15a20e/chrome/browser/android/webapk/webapk_installer_unittest.cc
[modify] https://crrev.com/bfbb56d2c317ff8e1def9d22e6753d942d15a20e/chrome/browser/android/webapk/webapk_update_manager.cc

Project Member

Comment 19 by bugdroid1@chromium.org, Oct 5 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/3b23851e5a67fab98c31cb58a746193608ccf4ce

commit 3b23851e5a67fab98c31cb58a746193608ccf4ce
Author: Peter Kotwicz <pkotwicz@chromium.org>
Date: Thu Oct 05 00:35:57 2017

[Android WebAPK] Delete "WebAPK update request" file if update is no longer needed

BUG= 713655 

Change-Id: Ie0d98bb91de833328472f4455661665013ff0296
Reviewed-on: https://chromium-review.googlesource.com/698953
Commit-Queue: Peter Kotwicz <pkotwicz@chromium.org>
Reviewed-by: Dominick Ng <dominickn@chromium.org>
Cr-Commit-Position: refs/heads/master@{#506586}
[modify] https://crrev.com/3b23851e5a67fab98c31cb58a746193608ccf4ce/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebApkUpdateManager.java

Project Member

Comment 20 by bugdroid1@chromium.org, Oct 27 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/9814f1e03b986979e9a90cc4357a7fa11bd00325

commit 9814f1e03b986979e9a90cc4357a7fa11bd00325
Author: Peter Kotwicz <pkotwicz@chromium.org>
Date: Fri Oct 27 16:14:59 2017

Update WebAPK after the user closes WebAPK

This CL hooks up updating WebAPKs to BackgroundTaskScheduler.
This has the following benefits:
- Preventing WebAPKs from being installed as a result of an update after a user
  uninstalls a WebAPK
- Making WebAPKs always occur when the WebAPK is not running. Previously,
  updates were triggered as a result of WebApkActivity#onStop(). If the
  onStop()-triggered update failed 3 times, the WebAPK switched to
  triggering updates on launch. (on update completion the running WebAPK would
  crash).

Bug:  713655 
Change-Id: I02a017c92625692819aed3a98959d16c91a0847b
Reviewed-on: https://chromium-review.googlesource.com/719497
Reviewed-by: Ted Choc <tedchoc@chromium.org>
Reviewed-by: Tommy Nyquist <nyquist@chromium.org>
Reviewed-by: Dominick Ng <dominickn@chromium.org>
Reviewed-by: Filip Gorski <fgorski@chromium.org>
Commit-Queue: Peter Kotwicz <pkotwicz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#512194}
[modify] https://crrev.com/9814f1e03b986979e9a90cc4357a7fa11bd00325/chrome/android/java/src/org/chromium/chrome/browser/metrics/WebApkUma.java
[modify] https://crrev.com/9814f1e03b986979e9a90cc4357a7fa11bd00325/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebApkActivity.java
[modify] https://crrev.com/9814f1e03b986979e9a90cc4357a7fa11bd00325/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebApkUpdateManager.java
[add] https://crrev.com/9814f1e03b986979e9a90cc4357a7fa11bd00325/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebApkUpdateTask.java
[modify] https://crrev.com/9814f1e03b986979e9a90cc4357a7fa11bd00325/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappDataStorage.java
[modify] https://crrev.com/9814f1e03b986979e9a90cc4357a7fa11bd00325/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappRegistry.java
[modify] https://crrev.com/9814f1e03b986979e9a90cc4357a7fa11bd00325/chrome/android/java_sources.gni
[modify] https://crrev.com/9814f1e03b986979e9a90cc4357a7fa11bd00325/chrome/android/javatests/src/org/chromium/chrome/browser/webapps/WebApkUpdateManagerTest.java
[modify] https://crrev.com/9814f1e03b986979e9a90cc4357a7fa11bd00325/chrome/android/junit/src/org/chromium/chrome/browser/webapps/WebApkUpdateManagerTest.java
[modify] https://crrev.com/9814f1e03b986979e9a90cc4357a7fa11bd00325/components/background_task_scheduler/android/java/src/org/chromium/components/background_task_scheduler/BackgroundTaskSchedulerUma.java
[modify] https://crrev.com/9814f1e03b986979e9a90cc4357a7fa11bd00325/components/background_task_scheduler/android/java/src/org/chromium/components/background_task_scheduler/TaskIds.java
[modify] https://crrev.com/9814f1e03b986979e9a90cc4357a7fa11bd00325/components/background_task_scheduler/android/junit/src/org/chromium/components/background_task_scheduler/BackgroundTaskSchedulerUmaTest.java
[modify] https://crrev.com/9814f1e03b986979e9a90cc4357a7fa11bd00325/tools/metrics/histograms/enums.xml

Project Member

Comment 21 by bugdroid1@chromium.org, Nov 1 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/818bcea97287ca28a736c3075fee3eef3a0a1576

commit 818bcea97287ca28a736c3075fee3eef3a0a1576
Author: Peter Kotwicz <pkotwicz@chromium.org>
Date: Wed Nov 01 19:58:04 2017

[Android WebAPK] Record metric with age of "pending update request" file

This CL adds a metric which records an approximation of how old the
"pending
update request" file is. The purpose of the metric is to assess how
often Chrome is killed by the OS during an update.

Bug= 713655 

Change-Id: I4f6177ec1be6ddb3e6321f9a79588cb8a36c6ec2
Reviewed-on: https://chromium-review.googlesource.com/671149
Commit-Queue: Peter Kotwicz <pkotwicz@chromium.org>
Reviewed-by: Yaron Friedman <yfriedman@chromium.org>
Reviewed-by: Dominick Ng <dominickn@chromium.org>
Reviewed-by: Ilya Sherman <isherman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#513230}
[modify] https://crrev.com/818bcea97287ca28a736c3075fee3eef3a0a1576/base/BUILD.gn
[add] https://crrev.com/818bcea97287ca28a736c3075fee3eef3a0a1576/base/android/junit/src/org/chromium/base/metrics/test/ShadowRecordHistogram.java
[modify] https://crrev.com/818bcea97287ca28a736c3075fee3eef3a0a1576/chrome/android/BUILD.gn
[modify] https://crrev.com/818bcea97287ca28a736c3075fee3eef3a0a1576/chrome/android/java/src/org/chromium/chrome/browser/metrics/WebApkUma.java
[modify] https://crrev.com/818bcea97287ca28a736c3075fee3eef3a0a1576/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappDataStorage.java
[modify] https://crrev.com/818bcea97287ca28a736c3075fee3eef3a0a1576/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappDirectoryManager.java
[modify] https://crrev.com/818bcea97287ca28a736c3075fee3eef3a0a1576/chrome/android/java_sources.gni
[add] https://crrev.com/818bcea97287ca28a736c3075fee3eef3a0a1576/chrome/android/junit/src/org/chromium/chrome/browser/webapps/MockWebappDataStorageClockRule.java
[modify] https://crrev.com/818bcea97287ca28a736c3075fee3eef3a0a1576/chrome/android/junit/src/org/chromium/chrome/browser/webapps/WebApkUpdateManagerUnitTest.java
[modify] https://crrev.com/818bcea97287ca28a736c3075fee3eef3a0a1576/chrome/android/junit/src/org/chromium/chrome/browser/webapps/WebappDataStorageTest.java
[modify] https://crrev.com/818bcea97287ca28a736c3075fee3eef3a0a1576/chrome/android/junit/src/org/chromium/chrome/browser/webapps/WebappDirectoryManagerTest.java
[modify] https://crrev.com/818bcea97287ca28a736c3075fee3eef3a0a1576/tools/metrics/histograms/histograms.xml

Status: Fixed (was: Assigned)
\o/
Thanks Peter!

Sign in to add a comment