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: Handle archived/deleted projects #324

Merged
merged 1 commit into from
Nov 1, 2023

Conversation

chriswk
Copy link
Contributor

@chriswk chriswk commented Nov 1, 2023

Previously, our cache refresh algorithm assumed that the response from upstream contained all projects we wanted to do updates to. Wayfair correctly reported this breaking their opportunity to archive/delete projects, since the cache would still contain deleted projects.

This patch updates Edge to use the projects the token has access to decide whether or not to keep the elements in cache.

New flow:

  1. Fetch projects from token
  2. Filter out all features belonging to these projects
  3. Extend remaining list with update from response
  4. Return extended list.

fixes: #323

Previously, our cache refresh algorithm assumed that the response from
upstream contained all projects we wanted to do updates to. Wayfair
correctly reported this breaking their opportunity to archive/delete
projects, since the cache would still contain deleted projects.

This patch updates Edge to use the projects the token has access to
decide whether or not to keep the elements in cache.

New flow:
1. Fetch projects from token
2. Filter out all features belonging to these projects
3. Extend remaining list with update from response
4. Return extended list.

fixes: #323
Copy link
Member

@sighphyre sighphyre left a comment

Choose a reason for hiding this comment

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

LGTM!

@chriswk chriswk merged commit 5ddd1f5 into main Nov 1, 2023
6 checks passed
@chriswk chriswk deleted the fix/cacheUpdatesShouldUseTokenProjectList branch November 1, 2023 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Cache refresh does not respect deleted/archived projects
2 participants