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

[BUG] Customer cache and fragment management #865

Open
3 of 4 tasks
ansmonjol opened this issue Mar 1, 2023 · 0 comments
Open
3 of 4 tasks

[BUG] Customer cache and fragment management #865

ansmonjol opened this issue Mar 1, 2023 · 0 comments

Comments

@ansmonjol
Copy link
Collaborator

ansmonjol commented Mar 1, 2023

Context

This ticket has a wide scope.

It all start with an Apollo warning about cache management

image

It happen when we udpate a customer metadata and remove one in the list.

Going further, it appear that the fragment management is messy, and that we manually udpate the cache, which we should not.

Basically, warning occurs because Apollo does not know what to do with the old metada list having more items that the received one.

This warning have been spotted during customer metadata and patched with a cache definition for customerMetadata

Steps to reproduce

You need to have a customer with one or more metadata
You need to remove the customerMetadata key in src/core/apolloClient/cache.ts

  • Edit customer infos
  • Delete one metadata
  • Save customer
    -> A warning should be prompted in your console

Work breakdown

  • Get rid of models single_object types on BE side
  • make sure the BE change is impacted on FE fragments definition
  • Refactor FE fragment definition and data management in the customer details and customer add/edit drawer
  • Remove customerMetadata key in src/core/apolloClient/cache.ts, remove manual cache update and make sure the warning is not present anymore when removing a metadata from an existing customer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant