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

User account reset when switching to history #339

Open
antho1404 opened this issue Jul 7, 2023 · 6 comments
Open

User account reset when switching to history #339

antho1404 opened this issue Jul 7, 2023 · 6 comments
Labels
bug Something isn't working

Comments

@antho1404
Copy link
Member

On the detail page of an NFT, if we switch between tabs bid/history, the information of the creator/owner are reset

Ex: https://dev.uaan.liteflow.com/tokens/97-0xcfbb45ff528c8ff6542887f631a1f704b92cf7db-34081265737503256337038727118962159868999502952850214258663667513124745213751?filter=history

Screen.Recording.2023-07-07.at.23.16.03.mov
@antho1404 antho1404 added the bug Something isn't working label Jul 7, 2023
@ismailToyran
Copy link
Member

Just for context, this is Apollo cache issue.

    cache: new InMemoryCache({
      typePolicies: {
        Account: {
          keyFields: ['address'],
        },
        Asset: {
          keyFields: ['chainId', 'collectionAddress', 'tokenId'],
        },
        Collection: {
          keyFields: ['chainId', 'address'],
        },
      },
    }).restore(windowApolloState || {}),

@ismailToyran
Copy link
Member

@antho1404 I remember having this issue on admin as well. And it's so hard to find an example that causes an issue. For example your account doesn't trigger this issue anymore. We could close this issue if you check and confirm?

But again, as this occurs very rarely, even if we close this, this might be an ongoing issue. On admin, to fix this, I had to remove Account from typePolicies as cache was causing this issue strangely.

@NicolasMahe
Copy link
Member

Should we even use the typePolicies of the Apollo cache?
Apollo cache works out of the box with queries' result, no need for typePolicies.

This typePolices is to enable a level of cache where provided type are extracted from queries' result and are cached and shared across the app. This cache is useful to avoid executing a refresh query when a mutation occurs for example, but we build the starter-kit without this in mind.

@antho1404
Copy link
Member Author

I would be food to close this issue as we can't reproduce anymore. If the apollo policies are an issue that could be done as a different issue

@EmmanuelDrouin
Copy link
Member

@antho1404 @ismailToyran are you good to close this issue? The last comment from October stated that it is very hard to reproduce and you were ready to close the issue

@ismailToyran
Copy link
Member

We don't have the cache implementation that was causing this issue anymore. So I'm pretty sure we can close this issue until we can produce it in the future somehow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants