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: item status #626

Merged
merged 2 commits into from
May 9, 2023
Merged

fix: item status #626

merged 2 commits into from
May 9, 2023

Conversation

spaenleh
Copy link
Member

@spaenleh spaenleh commented May 8, 2023

This PR fixes an issue where item statuses stopped showing.

There is still a reactivity issue, because the queries are not invalidating correctly, so the statuses do not updates when a single mutation updates them. This needs to be investigated further.
Invalidation should now work as expected. One trade-off is that all itemTags queries that target multiple items will refetch when one itemTag is changed. It looks like invalidation of query keys is made in order of the elements in the array, so it is not easily possible to invalidate one of the use many queries if it does not target the first id in the list:
Example of itemTags query keys: ["items", "itemTags", "many", "idA", idB", idC", ...] in this case it is possible to invalidate this query by using one of these:

  • ["items"]
  • ["items", "itemTags"]
  • ["items", "itemTags", "many"]
  • ["items", "itemTags", "many", "idA"]
    But using the following will not work:
  • ["items", "itemTags", "many", "idB"]
    So currently we use: ["items", "itemTags", "many"]

@spaenleh spaenleh self-assigned this May 8, 2023
@spaenleh spaenleh added the bug 🪲 Something isn't working label May 8, 2023
Copy link
Contributor

@codeofmochi codeofmochi left a comment

Choose a reason for hiding this comment

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

LGTM nice 🐞 hunt 😅

@spaenleh spaenleh merged commit 5bc43ab into main May 9, 2023
@spaenleh spaenleh deleted the hotfix-item-status branch May 9, 2023 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🪲 Something isn't working v0.12.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants