[Regression] Don't show Clipboard bar for URLs that are already open in a tab

RESOLVED FIXED

Status

()

RESOLVED FIXED
a year ago
10 months ago

People

(Reporter: SimonB, Assigned: jhugman, NeedInfo)

Tracking

unspecified
Other
iOS

Firefox Tracking Flags

(fxios10.0, fxios-v9.0 affected, fxios-v10.0 affected)

Details

(Whiteboard: [MobileCore][papercut])

Attachments

(1 attachment)

(Reporter)

Description

a year ago
Build: 246293a0b
Device: iPhone 7
iOS: 10.3.3

Same issue as Bug 1359865 is still reproducible on latest master and beta 9.0(5725). 


Case 1:

Copy the page URL, background Firefox, and come back -- you get a toast offering to open the current page.

Case 2:

3D Touch the app icon and choose "Go to copied link".

Firefox opens, and offers to go to the copied link. Then the tab opens and the toast goes away.

Cases 3..N:

I expect this happens for links opened from Outlook or queued with View Later, too.

We should check whether we already have open, or are about to open, the copied link *before* we show the toast.
Flagging Robin for details on what our expected behavior should be here.
tracking-fxios: ? → 9.1
Flags: needinfo?(randersen)
Whiteboard: [MobileCore][NeedsStrings][papercut]
tracking-fxios: 9.1 → 10.0
(Assignee)

Updated

11 months ago
Assignee: nobody → jhugman
(Assignee)

Comment 2

11 months ago
There are two things to do here: 

1) Detect if the URL is open in another tab.
2) If so, either offer to "Switch" to that tab, or not display the Clipboard bar at all.

Our current code is a little brittle: if the URL on the clipboard matches the one we offered to open last time, then don't offer to open it this time. 

We can put other URLs on the clipboard, then put the old one back, and it would offer to open it.

If the app is killed, the URL will be offered even if it's open.

Bug 1) should be fixed in this bug. Bug 2) is to change from not showing the bar to some other behaviour, perhaps "Switch".
(In reply to James Hugman [:jhugman] [@jhugman] from comment #2)

> 2) If so, either offer to "Switch" to that tab, or not display the Clipboard
> bar at all.

I suspect offering to switch isn't going to feel right: if I copy a URL, open it in Firefox, and then keep switching apps, Firefox will offer to switch each time I re-enter the app, no?

I'd do the simplest thing here: only offer to open a clipboard URL if (a) it isn't already open (this bug/Bug 1359865), and (b) we didn't already offer (already done?).


> We can put other URLs on the clipboard, then put the old one back, and it
> would offer to open it.

That's OK, though, no? If you re-copy a URL, with a pass through Firefox each time, and we don't have the tab open, it's not unreasonable to offer to open it.
(Assignee)

Comment 4

11 months ago
> I'd do the simplest thing here: only offer to open a clipboard URL if (a) it isn't already open (this bug/Bug 1359865), and (b) we didn't already offer (already done?).
Bug 1359865 fixed your (b).

> I suspect offering to switch isn't going to feel right: if I copy a URL, open it in Firefox, and then keep switching apps, Firefox will offer to switch each time I re-enter the app, no?
The "Switch" option: yes, you're right, unless we have a similar "don't offer the same url twice in a row" rule as (b). But this becomes less and less useful given that we only offer the URL at the beginning of each session.

> I'd do the simplest thing here: only offer to open a clipboard URL if (a) it isn't already open (this bug/Bug 1359865), and (b) we didn't already offer (already done?).
Agreed.
(Assignee)

Comment 5

11 months ago
Created attachment 8912195 [details] [review]
Link to Github pull-request: https://github.com/mozilla-mobile/firefox-ios/pull/3216
Attachment #8912195 - Flags: review?(gkeeley)
(Assignee)

Updated

11 months ago
Status: NEW → ASSIGNED
Iteration: --- → 1.30
Whiteboard: [MobileCore][NeedsStrings][papercut] → [MobileCore][papercut]

Updated

11 months ago
Attachment #8912195 - Flags: review?(gkeeley) → review+
(Assignee)

Comment 6

11 months ago
Merged into master.
Status: ASSIGNED → RESOLVED
Last Resolved: 11 months ago
Resolution: --- → FIXED
Whiteboard: [MobileCore][papercut] → [MobileCore][papercut][NeedsUplift]

Comment 7

10 months ago
UPlifted to v10.x
Whiteboard: [MobileCore][papercut][NeedsUplift] → [MobileCore][papercut]
You need to log in before you can comment on or make changes to this bug.