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

Introduced ConnectDispatch and apiDataCacheReducer. Organizing organized API data into ‘apiDataCache’ dictionary. (and more) #21

Merged
merged 3 commits into from
Feb 3, 2025

Conversation

DaleMcGrew
Copy link
Member

Introduced ConnectDispatch and apiDataCacheReducer. Organizing organized API data into ‘apiDataCache’ dictionary. Temporarily forcing react-query to always go to the network while we stabilize new data flow. Still upgrading Questionnaire to new approach. Still reviewing and moving edit mutations into models folder. Commented out many console.log lines. Reordered attributes in TextFields in EditPersonForm to alphabetical.

…zed API data into ‘apiDataCache’ dictionary. Temporarily forcing react-query to always go to the network while we stabilize new data flow. Still upgrading Questionnaire to new approach. Still reviewing and moving edit mutations into models folder. Commented out many console.log lines. Reordered attributes in TextFields in EditPersonForm to alphabetical.
Copy link
Member

@SailingSteve SailingSteve left a comment

Choose a reason for hiding this comment

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

The good thing about leaving one log line at the top of App.js, is it allows us to detect if we are restarting the app. If you see too many of them, it is a problem.

Copy link
Member

Choose a reason for hiding this comment

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

If this causes endless loop, there most likely is a problem in a useEffect after a query.

Copy link
Member

Choose a reason for hiding this comment

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

This still seems like a wasteful pattern. If you have the person object that is current enough to display it, why would you extract the id, and look the person up again in the function. I think this should be fixed now, so it does get propagated by copying the pattern.

Copy link
Member

@SailingSteve SailingSteve Feb 3, 2025

Choose a reason for hiding this comment

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

This seems broken, the passed in parameters in useFetchData are for search parameters on the API URL (or post params after my next checkin). Are you sure this is doing what you wanted? It might be the cause of other problems.

Copy link
Member

Choose a reason for hiding this comment

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

Refetching can't be the right way to go. I'm sure it fixes the symptoms, but destroys one of the key values in ReactQuery ... serving api queries from cache. This needs to be solved before we go on, and copy that pattern elsewhere. I can work on this.

@DaleMcGrew DaleMcGrew merged commit 14c4d1c into wevote:develop Feb 3, 2025
0 of 2 checks passed
@DaleMcGrew DaleMcGrew deleted the Dale_WCC_Feb1-2025 branch February 3, 2025 22:44
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