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

Fetch products on login; add getProductAbbreviation function #406

Merged
merged 9 commits into from
Nov 8, 2023

Conversation

jeffdaley
Copy link
Contributor

@jeffdaley jeffdaley commented Nov 6, 2023

Moves the ProductAreaService's fetch call to the /authenticated route and adds a getProductAbbreviation utility method. We now fetch ProductAreas at the component level (e.g., ProductSelect, Settings), but since we're planning to use abbreviations in the ProductAvatar, it would be helpful to have these loaded on login.

@jeffdaley jeffdaley marked this pull request as ready for review November 7, 2023 02:13
@jeffdaley jeffdaley requested a review from a team as a code owner November 7, 2023 02:13
Copy link
Collaborator

@jfreda jfreda left a comment

Choose a reason for hiding this comment

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

If I'm understanding this correctly, we'll only fetch the products on login with this change so if (in the probably rare case, but possible) a product is added while a user has an active session, it could cause an issue? If that's correct, should we do another fetch if we don't find a product in the productArea service?

@jeffdaley
Copy link
Contributor Author

if a product is added while a user has an active session, it could cause an issue?

FWIW, this wouldn't be a new issue. Even in the current code, ProductAreas are only fetched once per session.

I added a couple "refresh" calls to handle the case of new products being added. I think they make sense on the ProductSelect and SubscriptionList components but don't seem necessary for cosmetic stuff like avatars.

@jfreda
Copy link
Collaborator

jfreda commented Nov 8, 2023

FWIW, this wouldn't be a new issue.

Ah didn't realize that.

I added a couple "refresh" calls to handle the case of new products being added.

Cool, sounds good 👍

@jeffdaley jeffdaley merged commit fdbdc08 into main Nov 8, 2023
1 check passed
@jeffdaley jeffdaley deleted the jeffdaley/get-product-abbreviation branch November 8, 2023 22:54
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