Skip to content

Identities response is treated as transient when transient=false #5260

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

Open
1 of 4 tasks
hichamboushaba opened this issue Mar 28, 2025 · 2 comments
Open
1 of 4 tasks
Assignees
Labels
bug Something isn't working

Comments

@hichamboushaba
Copy link

How are you running Flagsmith

  • Self Hosted with Docker
  • Self Hosted with Kubernetes
  • SaaS at flagsmith.com
  • Some other way (add details in description below)

Describe the bug

Hey,

I'm experiencing an issue, and I'm not sure if I'm misunderstanding the feature, or if this is a bug.

I noticed that when passing transient=false to GET /api/v1/identities, the response ignores all the user traits, and returns only the default environment flags, the response matches exactly what I get when I pass transient=true.
To get segment and identity overrides, I need to make sure the transient parameter is not passed at all, in this case, the response includes the traits as well.

Is this an expected behavior?

With the addition to the transient argument to the SDKs (I'm using the android-kotlin one) and being false by default, this means that when trying to get the flags without passing in all the traits, it returns the default values, and not the expected ones.

Steps To Reproduce

  1. Create a user user_1 and add some traits.
  2. Create an override to a feature feature_1 for the user.
  3. Call GET /api/v1/identities?identifier=user_1&transient=false

Notice that feature_1 is using the environment default value and not the override.

Expected behavior

feature_1 should return the overriden value.

Screenshots

No response

@hichamboushaba hichamboushaba added the bug Something isn't working label Mar 28, 2025
@rolodato
Copy link
Member

@hichamboushaba Thanks for the detailed bug report. Currently the API checks if the transient parameter is present instead of looking at the true or false value, which explains the behaviour you're seeing:

if request.query_params.get("transient"):

I don't know what the expected behaviour is here, but the least intrusive way to solve this would be to have the Kotlin SDK exclude the transient parameter if it's not true. I'll look into sending a PR for this.

I'll also leave this issue open in case the dev team wants to make a decision on how we'd like to keep supporting the transient parameter.

hichamboushaba added a commit to hichamboushaba/flagsmith-kotlin-client that referenced this issue Mar 28, 2025
@hichamboushaba
Copy link
Author

hichamboushaba commented Mar 28, 2025

Thanks @rolodato.

I don't know what the expected behaviour is here, but the least intrusive way to solve this would be to have the Kotlin SDK exclude the transient parameter if it's not true. I'll look into sending a PR for this.

I was looking for a server fix to have a faster fix for my users, but I understand the concern.

Given I'm using my own fork of the library (to support Kotlin Multiplatform), I went ahead and implemented the same thing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants