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

Moped Editor: GridTable bug with cache enabled #4788

Closed
sergiogcx opened this issue Dec 28, 2020 · 5 comments
Closed

Moped Editor: GridTable bug with cache enabled #4788

sergiogcx opened this issue Dec 28, 2020 · 5 comments
Assignees
Labels
Impact: 2-Major Causes a major interruption of TPW service delivery Product: Moped A comprehensive mobility project tracking platform for Austin, Texas Project: Moped v1.0 First production release of our comprehensive mobility project tracking platform Service: Dev Infrastructure and engineering Type: Bug Report Something is not right Workgroup: DTS Data and Technology Services
Milestone

Comments

@sergiogcx
Copy link

There seems to be a strange problem happening when using the cache-first fetch policy in Apollo. It appears as if it is always loading. I do not understand why or how this bug happens.

In this case, I have been working on the projects list, and somehow it only affects certain sub-components of the GridTable component. This is fixed by using a no-cache policy, but it is strange that VZE was not affected by this. It is unpredictable what subcomponents will be affected, but more homework is needed.

2020-12-28_12-20-44 (1).gif

2020-12-28_12-20-08 (1).gif

@sergiogcx sergiogcx added Impact: 2-Major Causes a major interruption of TPW service delivery Product: Moped A comprehensive mobility project tracking platform for Austin, Texas Service: Dev Infrastructure and engineering Type: Bug Report Something is not right Workgroup: DTS Data and Technology Services labels Dec 28, 2020
@sergiogcx
Copy link
Author

I've been reading some threads, but nothing conclusive as to what may be happening:

apollographql/react-apollo#3361
magento/pwa-studio#2230
apollographql/react-apollo#3270

@amenity
Copy link
Contributor

amenity commented Dec 30, 2020

This is a problem in Apollo that we encountered in VZE. We averted it there by using a no-cache policy.

@amenity amenity removed this from the Sprint 41 milestone Dec 30, 2020
@amenity
Copy link
Contributor

amenity commented Dec 30, 2020

@mddilley - please review and see if ☝️ is still the right approach.

@amenity amenity added this to the Sprint 41 milestone Dec 30, 2020
@amenity
Copy link
Contributor

amenity commented Jan 8, 2021

This was addressed as described above.

@amenity amenity closed this as completed Jan 8, 2021
@amenity amenity reopened this Jan 8, 2021
@johnclary johnclary added the Project: Moped v1.0 First production release of our comprehensive mobility project tracking platform label Jan 11, 2021
@mddilley
Copy link

I spent some time looking at this and agree with Sergio and our previous experience in VZE that it is an elusive bug in the Apollo library. I was able to reproduce by changing rows per page in GridTable (as shown in the screenshot above).

I found some workarounds that involve triggering additional re-renders or using combined logic of loading and data results from useQuery, but it doesn't seem worth it at this point with no-cache fetch policy working.

Workarounds:
apollographql/react-apollo#3270 (comment)
apollographql/react-apollo#3774 (comment)

Hopefully, if this becomes a performance issue down the line, there will be a patch that addresses it on the Apollo side.

Migrating to @apollo/client https://www.apollographql.com/docs/react/migrating/apollo-client-3-migration/ might also fix this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Impact: 2-Major Causes a major interruption of TPW service delivery Product: Moped A comprehensive mobility project tracking platform for Austin, Texas Project: Moped v1.0 First production release of our comprehensive mobility project tracking platform Service: Dev Infrastructure and engineering Type: Bug Report Something is not right Workgroup: DTS Data and Technology Services
Projects
None yet
Development

No branches or pull requests

4 participants