New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 735074 link

Starred by 1 user

Issue metadata

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



Sign in to add a comment

Back button in Web APK doesn't navigate activities

Project Member Reported by esprehn@chromium.org, Jun 20 2017

Issue description

Chrome Version: 61.0.3136.0 Canary (but it's been this way for ages)
OS: Android

What steps will reproduce the problem?
(1) Install the twitter.com web apk.
(2) Open twitter and sign in.
(3) Tap a tweet, then a user, then another user.
(4) Switch the native Google Search app.
(5) Search for "twitter obama".
(6) Tap the result for twitter.

At this point your conceptual history stack looks like:

1. Login screen. (Twitter PWA)
2. Feed. (Twitter PWA)
3. Tweet. (Twitter PWA)
4. Profile. (Twitter PWA)
5. Another profile (Twitter PWA)
6. Google Search (GSA)
7. Obama twitter (Twitter PWA) <-- you're here.

(7) Now hit the back button.

What is the expected result?

Hitting back should take me back to GSA (to history item 6).

What happens instead?

Hitting back starts navigating the web apk through the entire history stack, so we jump to history item 5, and then start going through every page I've ever been to in the web apk. So hitting back takes me to "Another profile", then to "Profile." then to "Tweet", etc.

This means whenever you touch a link that takes you into a web apk you get trapped from an android history perspective which is frustrating as a user. It means you can't use web apks in the normal hub and spoke manner you could use native apps.
 

Comment 1 by owe...@chromium.org, Jun 20 2017

Cc: dominickn@chromium.org benwells@chromium.org sbirch@chromium.org piotrs@chromium.org yfried...@chromium.org
Does anyone know if this is something we can feasibly address? 
I'm not sure. I *think* it's feasible but also tricky to get right. If we did it with android task management, we'd probably have to keep separate history stacks per instance of the activity. Alternatively, we need to track how many history events are created per instance and when that reaches 0, hit the android back instead of continuing to navigate the backstack.

Note that many native apps also break this, sometimes intentionally sometimes not. For example, IIRC a deep link into a twitter post into the native app, then hitting back takes you to the feed (because Twitter wants to keep you engaged in their app).
Labels: -Pri-3 Pri-2
Ya, FullScreenActivity.handleBackPressed is pretty naive: if there's a history item, it goes back, regardless of what point in history brought the activity forward.

That said, the flow mentioned in OP doesn't seem right either (or at least after another back). If you're switching to "GSA" that's switching tab stack. So I think you actually have:

Task A
-----
1. Login screen. (Twitter PWA)
2. Feed. (Twitter PWA)
3. Tweet. (Twitter PWA)
4. Profile. (Twitter PWA)
5. Another profile (Twitter PWA)

Task B
------
1. Google Search (GSA)
2. Obama twitter (Twitter PWA) <-- you're here.

(7) Now hit the back button.

I agree that you should get to GSA. But hitting back again, should take you to the homescreen and not back to the PWA (at least I think that's how Android works :) The one tricky bit for us, is that we'd want to navigate the history state back but not actually reload the page until the user comes back to the page.

Anyway, we can put this on the polish and parity list. Thanks for raising it.



Owner: pkotw...@chromium.org
Status: Assigned (was: Untriaged)
Peter is interested in this
Status: Fixed (was: Assigned)

Sign in to add a comment