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: POST /identities incorrectly applies segment overrides when using null or empty identifier, only in Core API #5018

Merged

Conversation

khvn26
Copy link
Member

@khvn26 khvn26 commented Jan 20, 2025

Thanks for submitting a PR! Please check the boxes below:

  • I have added information to docs/ if required so people know about the feature!
  • I have filled in the "Changes" section below?
  • I have filled in the "How did you test this code" section below?
  • I have used a Conventional Commit title for this Pull Request

Changes

Fixes #4976.

The problem boiled down to transient identities not having a primary key, which caused the query for fetching identity feature states to include segment overrides that don't belong there.

How did you test this code?

Added a unit test reproducing the exact problem reported.

…ing null or empty identifier, only in Core API
@khvn26 khvn26 requested a review from a team as a code owner January 20, 2025 15:23
@khvn26 khvn26 requested review from matthewelwell and removed request for a team January 20, 2025 15:23
Copy link

vercel bot commented Jan 20, 2025

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

3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
docs ⬜️ Ignored (Inspect) Jan 20, 2025 3:23pm
flagsmith-frontend-preview ⬜️ Ignored (Inspect) Jan 20, 2025 3:23pm
flagsmith-frontend-staging ⬜️ Ignored (Inspect) Jan 20, 2025 3:23pm

@github-actions github-actions bot added api Issue related to the REST API fix labels Jan 20, 2025
Copy link
Contributor

github-actions bot commented Jan 20, 2025

Docker builds report

Image Build Status Security report
ghcr.io/flagsmith/flagsmith-api-test:pr-5018 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-e2e:pr-5018 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-frontend:pr-5018 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-api:pr-5018 Finished ✅ Results
ghcr.io/flagsmith/flagsmith:pr-5018 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-private-cloud:pr-5018 Finished ✅ Results

Copy link
Contributor

github-actions bot commented Jan 20, 2025

Uffizzi Preview deployment-60066 was deleted.

Copy link

codecov bot commented Jan 20, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.40%. Comparing base (b056831) to head (f393326).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5018   +/-   ##
=======================================
  Coverage   97.39%   97.40%           
=======================================
  Files        1192     1192           
  Lines       41639    41654   +15     
=======================================
+ Hits        40556    40571   +15     
  Misses       1083     1083           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@khvn26 khvn26 merged commit 3557e14 into main Jan 20, 2025
35 checks passed
@khvn26 khvn26 deleted the fix/incorrectly-applied-segment-overrides-transient-identities branch January 20, 2025 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Issue related to the REST API fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

POST /identities incorrectly applies segment overrides when using null or empty identifier, only in Core API
2 participants