class: center, middle # A Send Tab Story 📱 ✈️ 💻 ## Digging into Send Tab metrics 📈 ##### By Tarik Eshaq --- class: center, middle # I might talk little fast # so 🐻 with me --- # Agenda 📓 - Quickly cover **why** we're talking about send tab - A bit of context on some send tab metrics we track 💹 - Go with me on a journey of how send tab currently works ⛰️ - Expired Endpoints and what they may mean 🔍 - Some concrete ideas to **possibly** improve reliability - Feedback? thoughts? Questions why Tarik is doing this on the thursday before a long weekend 😠 --- class: center, middle # Why ❓ - [Users that use Send Tab like it](https://docs.google.com/presentation/d/10PVQzp5Fwxt5MN3Z6hEHbqVbp7M7dI6awFBlYB_-01A/edit#slide=id.g51a632fa40_0_658) - If we decide to push more users towards send tab, we should make sure it's reliable - Send Tab's current success rates are low. - There a lot of metrics around that we don't understand - We should build a shared understanding of the system so we can improve it --- class: center, middle # Context 📉 --- # Context 📉 ## The send tab success rate <img src="../../slides/send-tab/success-rate.png" width="50%"> --- # Context 📉 ### The FxA Push success rate, for send tabs <img src="../../slides/send-tab/fxa-success-rate.png" width="50%"> <img src="../../slides/send-tab/fxa-error-reason.png" width="50%"> --- class: center, middle # The Journey of a Send tab ⛰️🏖️ --- # The Journey of a Send tab ⛰️🏖️ 1. Device Registration: 1. Devices subscribe with autopush to get a push URL - As a part of the subscription, the device would tell autopush what kind of device it is 1. Devices register with FxA, and include the push URL <img src="https://docs.google.com/drawings/d/e/2PACX-1vRB2k7m4bSyNyEeo4WpbQC2Udx1-35wSx63EtGYcCs_awC6MCfdSX3y38ugNrOmCXDTfk0ssJR8zyl7/pub?w=480&h=360"> --- # The Journey of a Send tab ⛰️🏖️ 1. Device Registration 1. Device Selection: 1. A device retrieves the list of all devices registered to the user from FxA 1. The browser displays the list of devices that support send-tab 1. The user chooses which device(s) the would like to send to. <img src="../../slides/send-tab/device-selection.png" width="50%"> --- # The Journey of a Send tab ⛰️🏖️ 1. Device Registration 1. Device Selection 1. Sending the tab (at the device) 1. The device would send a request to FxA with the encrypted tab and which device it would like to send to. <img src="https://docs.google.com/drawings/d/e/2PACX-1vRS62ORX0iwSZcxkGVZrBMF6CDP0D-7asmGniEIsan4lHwSxVLNBpqk3GlNj_EsllLuBT0kpx0riH9n/pub?w=480&h=360"> --- # The Journey of a Send tab ⛰️🏖️ 1. Device Registration 1. Device Selection 1. Sending the tab (at the device) 1. Sending the tab (at FxA) 1. FxA would first persist that tab in storage (previously pushbox) 1. **FxA would record that a user is trying to send a tab** **(A)** 1. FxA would attempt to send the tab to autopush using the push URL for that receiving device <img src="https://docs.google.com/drawings/d/e/2PACX-1vR75HJiVe1KYPg8VDLI4pJvh9qglZD45q12YnJKnk8mwx4RgVnVIwq0ApeCKJnBopsLK8sKTKZtM99N/pub?w=480&h=360"> --- # The Journey of a Send tab ⛰️🏖️ 1. Device Registration 1. Device Selection 1. Sending the tab (at the device) 1. Sending the tab (at FxA) - **FxA would record that a user is trying to send a tab** **(A)** 1. Sending the tab (at autopush) 1. Autopush would connect to the appropriate service for that device (ex: fcm for android, apns for iOS) 1. Autopush does best-effort delivery <img src="https://docs.google.com/drawings/d/e/2PACX-1vQMC6RC_9Y8aFhGiY5XM_u54QBx2ohtjJCOlyzosOeKvijhaSGs3nWYwIf6iTMy6wtEawngOtw3fKVE/pub?w=480&h=360"> --- # The Journey of a Send tab ⛰️🏖️ 1. Device Registration 1. Device Selection 1. Sending the tab (at the device) 1. Sending the tab (at FxA) - **FxA would record that a user is trying to send a tab** **(A)** 1. Sending the tab (at autopush) 1. Sending the tab (at the third-party service) 1. It's unknown how this works, but it triggers the operating system at the recieving devices, or it fails silently <img src="https://docs.google.com/drawings/d/e/2PACX-1vSEvsciRxwDhJC2ry3637odA8BzafROAwYLhPb0gL2SBG_AvVplXIv85VvNXn-6D_wYw9VMKVF9dWkm/pub?w=480&h=360"> --- # The Journey of a Send tab ⛰️🏖️ 1. Device Registration 1. Device Selection 1. Sending the tab (at the device) 1. Sending the tab (at FxA) - **FxA would record that a user is trying to send a tab** **(A)** 1. Sending the tab (at autopush) 1. Sending the tab (at the third-party service) 1. Recieving the tab (through the push notification) 1. The device receives the push notification, then instantly polls FxA for the persisted tab in step 4 1. The tab is displayed to the user <img src="https://docs.google.com/drawings/d/e/2PACX-1vSKw1dlvMYw9sQLfEQYQANCt_IFk7IUgwvHnqmsKMZ1DU7VXfFvuefdKPcXLKsy5ecoMRcgm4Y3WoAT/pub?w=480&h=360"> --- # The Journey of a Send tab ⛰️🏖️ 1. Device Registration 1. Device Selection 1. Sending the tab (at the device) 1. Sending the tab (at FxA) - **FxA would record that a user is trying to send a tab** **(A)** 1. Sending the tab (at autopush) 1. Sending the tab (at the third-party service) 1. Recieving the tab (at device) 1. Recieving the tab (at FxA) 1. **Once the user polls for a tab, we record that a tab has been retrieved** **(B)** --- class: center, middle # The Journey of a Send tab ⛰️🏖️ ## The send tab success rate we look at is ## The number of records that are retrieved from FxA by polling vs number of send tabs triggered --- class: center, middle # The Journey of a Send tab ⛰️🏖️ ## The FxA push success rate ## The number of records that are sent successfully to autopush vs number of send tabs triggered --- <img src="https://docs.google.com/drawings/d/e/2PACX-1vRQju33yJXmDfxqUajMZsp69px3z2DTYefjok5UpM1NALNEzrhO1ecld8Fehg5ZhxDyFlM9DGmqmunz/pub?w=960&h=720"> --- class: center, middle # Expired Endpoints 🔍 😵💫 --- # Expired Endpoints 🔍 😵💫 <img src="../../slides/send-tab/fxa-error-reason.png" width="50%"> <img src="https://docs.google.com/drawings/d/e/2PACX-1vR75HJiVe1KYPg8VDLI4pJvh9qglZD45q12YnJKnk8mwx4RgVnVIwq0ApeCKJnBopsLK8sKTKZtM99N/pub?w=480&h=360"> --- # Expired Endpoints 🔍 😵💫 ## Even more expired Endpoints! <img src="../../slides/send-tab/fxa-general-push.png" width="100%"> --- # Expired Endpoints 🔍 😵💫 ## When do we get an expired endpoint? <img src="https://docs.google.com/drawings/d/e/2PACX-1vR07_0SWimngIqTclLkuoOt76yRMebSMwJ5E7E2mrUOQYsoga6KVpSBPX5CIGWlx9yNFcYria-ZqxQP/pub?w=600&h=800"> --- # Expired Endpoints 🔍 😵💫 ## How do devices recover <img src="https://docs.google.com/drawings/d/e/2PACX-1vQJjg7CNDotFhJYPn7UiqpYm9XFgI4034kNnU8m1Xomp3DwR2zEZLnlsODiTicgVXQOlxyZicE-KGOK/pub?w=600&h=800"> --- class: center, middle # Four types of expired endpoint devices 🔥 ## 1. Active Devices that will recover ## 2. Active Devices that don't recover but poll for send tab ## 3. Active Devices that don't recover and don't poll for send tab ## 4. Idle Devices that won't ever be used again --- # Insight 🤔 - Devices that are (3) and (4) contribute to **both**: - **FxA Push success metrics**, because we can't send a push to autopush. They don't have a valid URL --- # Insight 🤔 - Devices that are (3) and (4) contribute to **both**: - **FxA Push success metrics**, because we can't send a push to autopush. They don't have a valid URL - **The Send Tab Success rate**, because those are devices that will never retrieve their tabs from FxA as they won't poll for records --- class: center, middle # Ideas 💡 --- class: center, middle # Ideas 💡 ## Prune old devices in FxA #### Helps with Idle devices and removes them from the equation #### Ticket: https://mozilla-hub.atlassian.net/browse/FXA-6285 --- class: center, middle # Ideas 💡 ## Filter Devices list in browsers #### Helps with Idle devices and eliminates them as a send-tab target #### Does not fix the problem for other push notifications #### Tickets: [Desktop](https://mozilla-hub.atlassian.net/browse/SYNC-3207), [Mobile](https://mozilla-hub.atlassian.net/browse/SYNC-3206) #### PRs: [Desktop](https://phabricator.services.mozilla.com/D148203), [Mobile](https://github.com/mozilla/application-services/pull/4984) --- class: center, middle # Ideas 💡 ## Increase frequency devices check registration so they wake up more often #### Helps with Active devices so they recover faster #### It would also help to audit how different devices detect that their url is expired. #### Ticket: https://mozilla-hub.atlassian.net/browse/SYNC-3477 --- class: center, middle # Ideas 💡 ## Add polling for FxA on an interval in firefox-iOS #### Firefox iOS currently only polls when it receives a notification #### but if it's registration is expired (or the message is dropped) the tabs are never retrieved #### Ticket: https://mozilla-hub.atlassian.net/browse/SYNC-3478 --- class: center, middle # Ideas from discussions 💡💡 --- class: center, middle # Ideas from discussions 💡💡 ## Mobile devices should monthly get a new token and send it to autopush #### A possible reason we see so many expired endpoints is that devices don't use their push url for a period of time, then it expires #### https://firebase.google.com/docs/cloud-messaging/manage-tokens recommends clients to proactively update their registration each month #### Ticket: https://mozilla-hub.atlassian.net/browse/SYNC-3479 --- # Ideas from discussions 💡💡 ## Desktop should recover from an expired UAID properly and update it's FxA registration #### We should make sure that if firefox desktop notices it has an expired UAID it updates it's own records #### And updates its FxA registration #### Ticket: https://mozilla-hub.atlassian.net/browse/SYNC-3480 --- # Ideas 💡 - Prune old devices in FxA - Filter devices list in browsers - Increase frequency devices check registration so they wake up more often - Add polling on an interval in iOS 🙃 - Mobile devices should monthly get a new token and send it to autopush - Desktop should recover from an expired UAID properly and update it's FxA registration --- class: center, middle ## Thoughts? ## Other ideas? 👀