Bug: [Devtools] Feature tours don't work correctly when triggered from the devtools
Status: NEW
Priority: P2
Created: 2024-08-06 18:01:10+00:00
Resolved: 2024-08-21 17:34:46+00:00

When triggering a feature tour (see below for example) from the devtools, we run into an odd issue. The tour pref is set correctly, but the tour pref handler doesn't kick in and start showing the next screen. Instead, it seems to just stop the tour. You have to click "Modify" a second time to get the next screen to show up. This is weird since it works correctly outside the devtools. I don't have any idea yet what may be causing this, but probably the best place to start is stepping through the code path from the "Modify" button to ASRouter, to see what it's doing.

Example message:

```json
{"id":"NEWTAB_POCKET_CSAT_SURVEY","template":"feature_callout","content":{"id":"NEWTAB_POCKET_CSAT_SURVEY","template":"multistage","backdrop":"transparent","transitions":false,"disableHistoryUpdates":true,"tour_pref_name":"browser.newtab.feature-tour","tour_pref_default_value":"{\"screen\":\"NEWTAB_POCKET_CSAT_SURVEY_1\",\"complete\":false}","screens":[{"id":"NEWTAB_POCKET_CSAT_SURVEY_1","force_hide_steps_indicator":true,"anchors":[{"selector":"hbox#browser","hide_arrow":true,"absolute_position":{"bottom":"20px","right":"20px"}}],"content":{"position":"callout","layout":"survey","title":"Help Firefox improve this page","title_logo":{"imageURL":"chrome://branding/content/about-logo.png"},"subtitle":"How satisfied are you with Recommended by Pocket?","primary_button":{"label":"Submit","action":{"type":"MULTI_ACTION","collectSelect":true,"data":{"actions":[{"type":"SET_PREF","data":{"pref":{"name":"browser.newtab.feature-tour","value":"{\"screen\":\"NEWTAB_POCKET_CSAT_SURVEY_2\",\"complete\":false}"}}}]}},"disabled":"hasActiveMultiSelect"},"additional_button":{"label":"Terms of use","style":"link","action":{"data":{"args":"https://www.mozilla.org/about/legal/terms/mozilla/","where":"tabshifted"},"type":"OPEN_URL"}},"dismiss_button":{"action":{"type":"MULTI_ACTION","data":{"actions":[{"type":"BLOCK_MESSAGE","data":{"id":"NEWTAB_POCKET_CSAT_SURVEY"}},{"type":"SET_PREF","data":{"pref":{"name":"browser.newtab.feature-tour"}}}]},"dismiss":true}},"tiles":{"type":"multiselect","style":{"flexDirection":"column","alignItems":"flex-start"},"data":[{"id":"radio-very-satisfied","type":"radio","group":"radios","defaultValue":false,"icon":{"style":{"width":"14px","height":"14px","marginInline":"4px 0.5em"}},"label":{"raw":"Very Satisfied"},"action":{"type":"SET_PREF","data":{"pref":{"name":"messaging-system-action.pocket-csat","value":"very-satisfied"}}}},{"id":"radio-satisfied","type":"radio","group":"radios","defaultValue":false,"icon":{"style":{"width":"14px","height":"14px","marginInline":"4px 0.5em"}},"label":{"raw":"Happens as soon as a message is loaded. This trigger does not require any user interaction, and may happen potentially as early as app launch, or at some time after experiment enrollment."},"action":{"type":"SET_PREF","data":{"pref":{"name":"messaging-system-action.pocket-csat","value":"Satisfied"}}}},{"id":"radio-neutral","type":"radio","group":"radios","defaultValue":false,"icon":{"style":{"width":"14px","height":"14px","marginInline":"4px 0.5em"}},"label":{"raw":"Neutral"},"action":{"type":"SET_PREF","data":{"pref":{"name":"messaging-system-action.pocket-csat","value":"neutral"}}}},{"id":"radio-dissatisfied","type":"radio","group":"radios","defaultValue":false,"label":{"raw":"Dissatisfied"},"icon":{"style":{"width":"14px","height":"14px","marginInline":"4px 0.5em"}},"action":{"type":"SET_PREF","data":{"pref":{"name":"messaging-system-action.pocket-csat","value":"dissatisfied"}}}},{"id":"radio-very-dissatisfied","type":"radio","group":"radios","defaultValue":false,"label":{"raw":"Very Dissatisfied"},"icon":{"style":{"width":"14px","height":"14px","marginInline":"4px 0.5em"}},"action":{"type":"SET_PREF","data":{"pref":{"name":"messaging-system-action.pocket-csat","value":"very-dissatisfied"}}}},{"id":"radio-dont-use","type":"radio","group":"radios","defaultValue":false,"icon":{"style":{"width":"14px","height":"14px","marginInline":"4px 0.5em"}},"label":{"raw":"I don't use it"},"action":{"type":"SET_PREF","data":{"pref":{"name":"messaging-system-action.pocket-csat","value":"dont-use"}}}}]}}},{"id":"NEWTAB_POCKET_CSAT_SURVEY_2","force_hide_steps_indicator":true,"anchors":[{"selector":"hbox#browser","hide_arrow":true,"absolute_position":{"bottom":"20px","right":"20px"}}],"content":{"layout":"inline","position":"callout","title":"Thanks for your feedback!","title_logo":{"imageURL":"https://firefox-settings-attachments.cdn.mozilla.net/main-workspace/ms-images/706c7a85-cf23-442e-8a92-7ebc7f537375.svg"},"dismiss_button":{"action":{"type":"SET_PREF","data":{"pref":{"name":"browser.newtab.feature-tour"}},"dismiss":true}},"page_event_listeners":[{"params":{"type":"timeout","options":{"once":true,"interval":5000}},"action":{"dismiss":true}},{"params":{"type":"tourend","options":{"once":true}},"action":{"type":"BLOCK_MESSAGE","data":{"id":"NEWTAB_POCKET_CSAT_SURVEY"}}}]}}]},"priority":1,"targeting":"true","trigger":{"id":"nthTabClosed"}}
```