Closed Bug 1688270 Opened 2 years ago Closed 2 years ago

Refactor save to Pocket button messaging system

Categories

(Firefox :: Pocket, enhancement, P2)

enhancement

Tracking

()

VERIFIED FIXED
87 Branch
Iteration:
87.1 - Jan 25 - Feb 7
Tracking Status
firefox87 --- verified

People

(Reporter: thecount, Assigned: thecount)

References

Details

Attachments

(1 file)

Right now the messaging system used for the save to Pocket button is standard js element events passing messages to and from the iframe. I think the main message system can be moved to JSWindowActors.

A few goals or advantages to this refactor.
Move to JSWindowActors.
I think a few chunks of the code can be deleted or simplified.
It'll make us less dependent to iframes, opening us up to some future options like: browser element over iframe, and better debugging tools.

Assignee: nobody → sdowne
Priority: -- → P2

Because of the nature of refactoring messages, almost every interaction in the doorhanger should be tested, to test each of these:

Test panels

  1. Create or have a Pocket account ready.
  2. Try to save a page while logged out of pocket.
    Expected: Should see a login page.
  3. Log in.
  4. Try to save a page.
    Expected: should see a save confirmation page.

Test premium

  1. Log in with a premium account, or set extensions.pocket.settings.premium_status to 1
  2. Try to save a page.
    Expected: should see suggested tags.
    Expected: Panel height should match the content.

Test regular

  1. Log in with a regular account, or set extensions.pocket.settings.premium_status to 0
  2. Try to save a page.
    Expected: should not see suggested tags.
    Expected: Panel height should match the content.

Test on save recs

  1. Try to save a page.
    Expected: Should see 3 recommended recs.
    Expected: Panel height should match the content.
  2. Try to save a page without on save recs, I use https://www.youtube.com/.
    Expected: Should not see 3 recommended recs.
    Expected: Panel height should match the content.

Test error states

  1. Go to the page about:robots
  2. Try to save it.
    Expected: Should show an error message.
    Expected: Panel height should match the content.
  3. Turn off your local internet connection.
  4. Try to save a different page.
    Expected: Should show a different error message.
    Expected: Panel height should match the content.

Test panel heights that were not tested above

  1. Save https://www.youtube.com/ without premium.
    Expected: Panel height should match content.
  2. Save https://www.youtube.com/ with premium.
    Expected: panel height should match content.

Test buttons and links

  1. Log out.
  2. Click the save to Pocket button.
  3. Should see 4 links/buttons, learn more, sign up with firefox, sign up with email, and sign in.
  4. Click each of them.
    Expected: Should take you to getpocket.com pages for firefox_learnmore, ff_signup, signup, and login.

Test telemetry

  1. Set browser.ping-centre.log to true
  2. Log out of Pocket.
  3. Try to save a page.
    Expected: should see a pocket ping with {"action":"click","source":"save_button"} and "pocket_logged_in_status":false
  4. Log in to Pocket.
  5. Try to save a page.
    Expected: should see a similar pocket ping but this time with "pocket_logged_in_status":true
  6. Try to save a page that shows on save recs
    Expected: should see a similar pocket ping but this time with [{"action":"impression","position":0,"source":"on_save_recs"},{"action":"impression","position":1,"source":"on_save_recs"},{"action":"impression","position":2,"source":"on_save_recs"}]
Iteration: --- → 87.1 - Jan 25 - Feb 7
Blocks: 1692066
Pushed by sdowne@getpocket.com:
https://hg.mozilla.org/integration/autoland/rev/66ae0882ef55
Refactor save to Pocket button messaging system r=gvn,mconley
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 87 Branch

We have verified all the scenarios mentioned in comment 2 and sent a Testing Report via email. You can also see it here.

Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.