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

Update view model snapshot correctly in cache #500

Merged
merged 1 commit into from
Oct 25, 2023
Merged

Conversation

smitpatel
Copy link
Member

Noticed we were not removing deleted resource from snapshot.

switch (objectChangeType)
{
case ObjectChangeType.Added:
_resourcesMap.Add(resource.Name, resource);
Copy link
Member

Choose a reason for hiding this comment

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

I think it was commented in a previous PR for a different section that the Added/Modified cases are effectively the same (unless we get an add for something already present, which would throw an exception. I'm ok with the distinction, just noting it since it caused me some confusion last night when "modified" changes for something not already in the map acted like adds.

Copy link
Member Author

Choose a reason for hiding this comment

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

The separation helps with re-add errors. The case you show won't cover. If we collapse then it would make behavior you see occur for more scenarios, hiding potentially more errors.

@smitpatel smitpatel merged commit 21356f7 into main Oct 25, 2023
4 checks passed
@smitpatel smitpatel deleted the smit/bugfix branch October 25, 2023 20:02
@github-actions github-actions bot locked and limited conversation to collaborators May 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants