Closed Bug 1645834 Opened 9 months ago Closed 9 months ago

Don't keep trying to send tabs if the server has rate-limited us

Categories

(Firefox :: Firefox Accounts, task)

task

Tracking

()

RESOLVED FIXED
Firefox 79
Tracking Status
firefox79 --- fixed

People

(Reporter: vladikoff, Assigned: vladikoff)

Details

Attachments

(1 file)

From GitHub (https://github.com/mozilla/application-services/issues/3105):

Both Fenix and Desktop have UI that supports sending multiple tabs at once. In fact the user can easily attempt to send themselves many hundreds or thousands of tabs by right-clicking the tab bar, choosing "select all tabs", and then "send N tabs to device". The send-tab infrastructure only supports sending one tab at a time. So sending N tabs gets turned into N calls to our send_tab function.
This does not work out well for large values of N.
The FxA server has some anti-abuse rate-limiting on the /invoke_command endpoint that underlies send-tab. It's generous, designed mostly to stop really obvious abuse or really serious client bugs that might otherwise bring down the service. So the first n < N tabs will be sent successfully, but all the rest will be rejected by the server with a 429 error. This error appears to be silently dropped - not only does the user not receive feedback that some tabs failed to send, but the client keeps attempting to send all the remaining tabs!
We should, instead, not do that, and refuse to attempt any more tab sending according to the backoff information given by the FxA server.
I believe this issue to exist on both Desktop and the rust fxa-client, but I'm filing it here because we might end up fixing it in Desktop by replacing its send-tab implementation with the rust component.
(By the way, there is also convenient UI for sending tabs to "all devices" as a single action. With M devices connected to your account this produces N x M individual send_tab calls. You can imagine how well that will work out for large values of both N and M...)

Pushed by vlad@vladikoff.com:
https://hg.mozilla.org/integration/autoland/rev/7ee9e9729d0b
Don't keep trying to send tabs if the server has rate-limited us. r=rfkelly
Status: NEW → RESOLVED
Closed: 9 months ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 79
You need to log in before you can comment on or make changes to this bug.