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

Add condition for getting max revision id from store #4549

Merged
merged 2 commits into from
Sep 29, 2023
Merged

Add condition for getting max revision id from store #4549

merged 2 commits into from
Sep 29, 2023

Conversation

pangorgo
Copy link
Contributor

About the changes

In our staging setup, we create ad-hoc environments and import Unleash state from production. After unleash is deployed on such environment, the import job kicks in and feeds Unleash instance with feature flags from production.

Between Unleash being up and running and the import job running, some applications start polling Unleash. They get an empty feature toggle list with meta.revisionId=0. Then apps use this as part of eTag header in subsequent requests. Even though after import Unleash server finally has toggles to serve, it doesn't because it calculates max revision id based on toggle updates (not null feature_name column in query) or SEGMENT_UPDATED.

This change adds an extra condition to query so feature toggles import is considered something that should invalidate the cache.

@vercel
Copy link

vercel bot commented Aug 23, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
unleash-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 29, 2023 1:04pm
unleash-monorepo-frontend ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 29, 2023 1:04pm

@vercel
Copy link

vercel bot commented Aug 23, 2023

@pangorgo is attempting to deploy a commit to the unleash-team Team on Vercel.

A member of the Team first needs to authorize it.

@pangorgo
Copy link
Contributor Author

@sjaanus @chriswk @ivarconr is there anything I can do to get this change reviewed and merged? Are any further explanations required?

@ivarconr
Copy link
Member

@sjaanus @chriswk @ivarconr is there anything I can do to get this change reviewed and merged? Are any further explanations required?

This works. But you should consider using the new import/export, which will not have these issues.

@ivarconr ivarconr enabled auto-merge (squash) September 29, 2023 12:57
@@ -2,6 +2,8 @@ import {
IEvent,
IBaseEvent,
SEGMENT_UPDATED,
FEATURE_IMPORT,
FEATURES_IMPORTED,
Copy link
Member

Choose a reason for hiding this comment

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

State service, which creates these event types, are deprecated and will go away in Unleash v6. We need to keep this until then.

@ivarconr ivarconr merged commit 486c174 into Unleash:main Sep 29, 2023
6 of 7 checks passed
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.

None yet

2 participants