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 task attributes cache #2023

Merged
merged 2 commits into from
Feb 5, 2020
Merged

Fix task attributes cache #2023

merged 2 commits into from
Feb 5, 2020

Conversation

ceolson01
Copy link
Contributor

Description

This PR fixes two particular issues, and likely prevents a couple of related cache bugs from surfacing in the future.

Most notably - in cases where an expanded user and their address are both fields on query types, we now accept both fields in mutation results. This solves some cache issues related to task worker assignment not updating immediately in task lists.

Also, this PR ensures that a task is added or removed from the user task list when they've assigned or unassigned themselves, respectively.

Closes #2012

@ceolson01 ceolson01 added this to the Sprint 43 milestone Feb 4, 2020
@ceolson01 ceolson01 requested review from rdig and chmanie February 4, 2020 17:36
@ceolson01 ceolson01 self-assigned this Feb 4, 2020
address: walletAddress,
} as UserTasksQueryVariables,
},
];
Copy link
Contributor Author

Choose a reason for hiding this comment

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

In theory, this could be done as a cacheUpdates function, but would be quite messy, as it would require us to expand some of our existing queries unnecessarily, just for when this case occurs (user assigns or unassigns themselves). I can't imagine this is going to happen often enough to warrant such implementation.

Copy link
Member

@rdig rdig left a comment

Choose a reason for hiding this comment

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

Works as advertised. Very nice work Curtis!

demo-properly-updated-task-list

Note: I inadvertently caught a bug while doing the demo: you can't remove payment on the task. We'll need to put in a fix for this at some point.

@rdig rdig removed this from the Sprint 43 milestone Feb 5, 2020
@ceolson01 ceolson01 merged commit 1b94066 into master Feb 5, 2020
@ceolson01 ceolson01 deleted the fix/2012-task-attributes-cache branch February 5, 2020 15:40
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.

Changing task assignee does not update those values in the task list
2 participants