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: refresh entitlements on tvod purchase #31

Conversation

ChristiaanScheermeijer
Copy link
Member

Description

While testing, we found that the player never updated automatically after purchasing a TVOD item. This causes the user to be unable to play back the purchased content.

After a lot of testing and trying out different fixes, I created a temporary fix using a callback argument.

The problem

To eliminate the react dependency, we've migrated react-query to @tanstack/query-core in the common package. This didn't seem to have an impact on the app. However, it turns out that the queryClient from the common package was never being used. Instead, a different queryClient was instantiated in the ui-react package.

React Query upgrade

The most straightforward fix was to upgrade react-query to @tanstack/react-query so the new queryClient could be used. However, react-query has some breaking changes, which changed all useQuery statements. Specifically, when upgrading to v4, all isLoading properties must be refactored to isFetching or isInitialLoading. I tried this upgrade, but it was too large and risky for now.

Current fix

The AccountController only uses the queryClient for entitlement invalidation in 2 places. I added a temporary callback to the AccountController, which is set from the useBootstrapApp hook.

It is not the cleanest fix, but the least risky for now.

@ChristiaanScheermeijer ChristiaanScheermeijer changed the title fix: refresh entitlements on tvod purchase Fix: refresh entitlements on tvod purchase Jan 18, 2024
Copy link

@langemike langemike left a comment

Choose a reason for hiding this comment

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

Looks good!

@ChristiaanScheermeijer ChristiaanScheermeijer merged commit d1ddcdb into feat/release-sprint-2024-1 Jan 18, 2024
6 checks passed
@ChristiaanScheermeijer ChristiaanScheermeijer deleted the fix/refresh-entitlements-for-tvod branch January 18, 2024 10:36
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