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

Fix logic keeping users on expired route even after time has been added #7796

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tobias-jarvelov
Copy link
Contributor

@tobias-jarvelov tobias-jarvelov commented Mar 11, 2025

When a user creates an account in the app and
then adds time to the account outside of the app
the user should then be shown the
"/main/time-added" route.

Whenever an account is created in the app, it's
expiredStatus is set immediately to "expired",
which makes the app show the "/main/expired"
route. When time is added to the account its
expiredStatus changes to "time_added" and this
should show the "/main/time-added" route.

However, due to an overly broad condition
in the logic to determine when the
"/main/expired" route should be shown, this
caused the "main/time-added" route to never be
shown, as the overly broad condition effectively
prevented the logic to determine when to show the
"/main/time-added" route from ever being called.

This overly broad condition erroneously targeted
all new accounts created from within the app and
prevented the transition to the "/main/time-added"
route.

To fix the problem we update the logic regarding
when to show the "/main/expired" route to not
check if the account is new, as it is enough to
only check if the account is logged in and that
its expiredStatus is "expired".

This change allows the logic to determine when
the "/main/time-added" route should be shown to
be called and as such can allow the route to be
shown after time has been added.


This change is Reviewable

When a user creates an account in the app and
then adds time to the account outside of the app
the user should then be shown the
"/main/time-added" route.

Whenever an account is created in the app, it's
expiredStatus is set immediately to "expired",
which makes the app show the "/main/expired"
route. When time is added to the account its
expiredStatus changes to "time_added" and this
should show the "/main/time-added" route.

However, due to an overly broad condition
in the logic to determine when the
"/main/expired" route should be shown, this
caused the "main/time-added" route to never be
shown, as the overly broad condition effectively
prevented the logic to determine when to show the
"/main/time-added" route from ever being called.

This overly broad condition erroneously targeted
all new accounts created from within the app and
prevented the transition to the "/main/time-added"
route.

To fix the problem we update the logic regarding
when to show the "/main/expired" route to not
check if the account is new, as it is enough to
only check if the account is logged in and that
its expiredStatus is "expired".

This change allows the logic to determine when
the "/main/time-added" route should be shown to
be called and as such can allow the route to be
shown after time has been added.
Copy link
Member

@raksooo raksooo left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 1 files at r1, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved

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