Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Applications doesn't handle error during in browser subscription #9474

Open
data-sync-user opened this issue May 2, 2024 · 5 comments
Open

Comments

@data-sync-user
Copy link
Collaborator

data-sync-user commented May 2, 2024

I am not sure how to manually reproduce this, but I recently wrote a functional test that mocked this scenario inside the testSubscriptionNeeded test suite:

it("subscription error", async () => {
  // Click the "Subscribe now" button
  await vpn.waitForQueryAndClick(queries.screenSubscriptionNeeded.SUBSCRIPTION_NEEDED_BUTTON.visible());

  // Override directly in the running guardian server for this test.
  // Note: this is mocking an internal server error, but we should mock other stuff.
  this.ctx.guardianServer.overrideEndpoints = {
    POSTs: {
      '/api/v2/vpn/login/verify': {
        status: 500,
      }
    }
  };

  // Subscription, for Guardian, is the same as in-browser auth.
  await vpn.mockInBrowserAuthentication();

  // Sleep for a minute, see what happens here. 
  // Spoiler: user is left hanging.
  await vpn.wait(60 * 1000);

  // Reset the Gaurdian overrides.
  this.ctx.guardianServer.overrideEndpoints = this.ctx.guardianOverrideEndpoints;
});

Expected behaviour:

  • Application handles the error gracefully e.g. by showing the user a message and automatically cancelling the subscription flow.

Actual behaviour:

  • Aplication does nothing and it is up to the user to manually cancel the subscription flow.

┆Issue is synchronized with this Jira Task
┆Reporter: Beatriz Rizental Machado

@data-sync-user data-sync-user changed the title Applications doesn't handle error during in browser authentication Applications doesn't handle error during in browser subscription May 2, 2024
@data-sync-user
Copy link
Collaborator Author

➤ Valentina Virlics commented:

Beatriz Rizental Machado stating a subscription from the client, and having a different currency in the browser, should trigger a subscription error in the web, I think. Should this work to verify this?

@data-sync-user
Copy link
Collaborator Author

➤ Beatriz Rizental Machado commented:

Valentina Virlics It might work! The error returned by the browser will be different for sure. Would you mind checking and letting me know?

@data-sync-user
Copy link
Collaborator Author

➤ Valentina Virlics commented:

While disconnecting from the internet, nothing happens in the client, but I suppose, this is not yet fixed Seems like a good way to verify it after the fix.

!image-20240502-132115.png|width=1508,height=829,alt="image-20240502-132115.png"!

@data-sync-user
Copy link
Collaborator Author

➤ Beatriz Rizental Machado commented:

Awesome, thanks!

@data-sync-user
Copy link
Collaborator Author

➤ Santiago Andrigo commented:

{panel:bgColor=#deebff}
Moving to high as this can block a user from moving forward during the user journey of purchasing a VPN sub.
{panel}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant