Exclude transient query parameter from identities request when false#64
Conversation
|
Hi @matthewelwell, actually, this is another side of the issue. |
I'm not sure I understand what you mean by 'response' part, but on inspection, I think that the PR I shared only covers the POST by modifying the request / json body, not the GET request. @rolodato are you able to contribute to the conversation here? |
|
@matthewelwell Anyway, we found this issue using 1.7.3 (the latest) version. |
|
Ok, thanks @SergeiRR - is there a way to catch this further upstream though? It seems like the queryInterceptor is having to correct something that's happened earlier in the URL building - couldn't we just prevent the query parameter being added earlier in the codepath? |
|
@matthewelwell yes, we can use if (transient) transient else nullto every function call (currently there are 2 calls that use But this may cause misunderstandings in the future. |
|
@matthewelwell Hi, any activity on this? This issue still affects us. |
|
I understand the correct fix would be to remove the call to However, we can't simply switch from GET to POST calls because of how the client implements caching. We cache API responses by adding a The problem is that OkHttp will not cache POST responses: https://github.com/square/okhttp/blob/2f78681a1f5ef5d9cc4f7bce48b9975f79c06978/okhttp/src/commonJvmAndroid/kotlin/okhttp3/Cache.kt#L231-L235 This means that we would need to implement our own caching separate from OkHttp. As an interim solution, I changed this PR's approach to:
|
matthewelwell
left a comment
There was a problem hiding this comment.
@rolodato I'm not sure that this is actually any improvement on @SergeiRR 's implementation since we still have the interceptor logic included which was what I was hoping that we could remove.
I do see, however, that we should include it, even with your change, in case any user explicitly sets transient: false.
I'm unsure then what benefit we get from including your change?
|
It would have been an improvement, if I had remembered to actually remove the interceptor :) It's fixed now. |
|
@rolodato can you merge this into a native branch, other than main, so we can verify the test / build process and then let's get it merged and released. |
1a35341
into
Flagsmith:fix/exclude-transient-false
Currently, get identities request contains
transientquery parameter only when set totrue.Previously, this bug would result in an unexpected flag state for the user identity.