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

suggestion: Handle session expiration gracefully #526

Merged
merged 9 commits into from
Nov 15, 2024

Conversation

cmaddox5
Copy link
Contributor

Even after #520, we still need to handle errors when someone has Screenplay open during a deploy. I think this can best be handled by looking for api in the previous path and returning a 403 instead of a redirect. This allows us to throw/catch an exception on the client and display a modal letting the user know they need to refresh the page.

Screenshot 2024-10-15 at 1 51 35 PM

@cmaddox5 cmaddox5 requested a review from a team as a code owner October 15, 2024 17:52
lib/screenplay_web/auth_manager/error_handler.ex Outdated Show resolved Hide resolved
.catch((response: Response) => {
if (response.status === 403) {
setIsAlertsIntervalRunning(false);
setShowModal(true);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems we'd only show this modal if, specifically, a background alerts request fails. How is the experience if some other kind of "foreground" request fails? Should we try to integrate this into all instances where we fetch data from the server?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because this task was already kind of scope creep-y, I focused specifically on what I knew to be the problem we see in Sentry.

You do raise a good point though. We've had a habit of assuming a request will be successful so we unintentionally fail silently in some areas. For example, I hardcoded a 500 for the Associate with alert page and the only indicator that something went wrong is that the table is empty. Because this would be a bigger task, I'll get it added to the backlog for us to talk about in the future.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you end up writing this task? (sorry for letting this review drop off)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just wrote it up here.

Copy link
Contributor

@digitalcora digitalcora left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good improvement to the UX as-is, so let's :shipit:

@cmaddox5 cmaddox5 merged commit 2dcad9a into main Nov 15, 2024
2 checks passed
@cmaddox5 cmaddox5 deleted the cm/handle-session-end branch November 15, 2024 15:05
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

Successfully merging this pull request may close these issues.

2 participants