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

ET-128: stop polling when session is complete + change error message #258

Merged
merged 5 commits into from
Aug 28, 2024

Conversation

mohsinht
Copy link
Contributor

@mohsinht mohsinht commented Aug 27, 2024

See this ticket for context: https://linear.app/awell/issue/ET-128/error-message-displayed-after-flow-completion-in-ahp-sessions


Summary:

  • The useHostedSession hook uses GetHostedSession graphql query to fetch latest status of the hosted session.
  • The query is fetched with a poll interval of 2 seconds.
  • The query fails after the hosted session is completed because the access to the Awell API is revoked from the backend.
  • This results in "Unauthorized" error in the AHP, which does not make sense to the user.

Solution:

  • If the hosted session is complete, stop polling the GetHostedSession query.
  • If the result of GetHostedSession fails because of Unauthorised error, show that the session has expired/completed instead of "Something went wrong".

Copy link

vercel bot commented Aug 27, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
hosted-pages ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 27, 2024 4:30pm

@mohsinht mohsinht added echoes/impediment: technical-debt Change made difficult by technical debt (e.g., high coupling, lack of tests) echoes/intent: throughput Anything that facilitates delivery (build more stuff quickly & efficiently) labels Aug 27, 2024
@mohsinht mohsinht merged commit 02cfaef into main Aug 28, 2024
5 checks passed
@mohsinht mohsinht deleted the et-128-hosted-session-error-after-completion branch August 28, 2024 12:38
Copy link

sentry-io bot commented Aug 29, 2024

Suspect Issues

This pull request was deployed and Sentry observed the following issues:

  • ‼️ Error: Should have a queue. This is likely a bug in React. Please file an issue. useHostedSession(src/hooks/useHostedSession/use... View Issue

Did you find this useful? React with a 👍 or 👎

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
echoes/impediment: technical-debt Change made difficult by technical debt (e.g., high coupling, lack of tests) echoes/intent: throughput Anything that facilitates delivery (build more stuff quickly & efficiently)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants