Closed SimeonKostov closed 1 year ago
Hi, @SimeonKostov! Thanks for reporting this. But I'm not sure I understand exactly what the bug you are describing is. Could you elaborate?
You say that "there was an issue with the variant splitting for one of our feature flags". What was that issue? You later refer to it as the "splitting issue". What exactly is happening? Are you not seeing the split? Or is it "flip-flopping" between rerenders?
And in terms of the variant configuration, what have you set as the stickiness? Are you using the "default" stickiness?
Looking at it locally and some of the tests we've got (plus a few more I just added), things seem to be working as expected on my end 🤔 Looking forward to get some clarification on your end.
Someone informed me that this probably comes from this community slack thread that has a lot more context, so I'm putting the link here for that case.
I don't know exactly what's happening here, but I tried reproducing the case you were seeing in the tests in #147, but it seems to work as expected.
Regarding undefined
being stringified to "undefined"
: shouldn't you see it in the query parameters you send in that case? I also can't reproduce that in the tests in any way. Not ruling it out completely, but I'm not sure why it would behave that way outside the tests 🤔
@thomasheartman Sorry for the confusing description!
Someone informed me that this probably comes from this community slack thread that has a lot more context, so I'm putting the link here for that case.
True! The issue is related to this thread.
This was our case:
useEffect(() => {
updateContext({userId});
}, [userId])
control
and challenger
variants with a weight of 50%updateContext
is called, should be called with {userId: undefined}
control
and those that had seen the challenger
- for the period 01.03-03.03
the numbers were 569 (control)
vs. 84 (challenger)
useEffect(() => {
if (userId) {
updateContext({userId});
}
}, [userId])
Those observations made us think that there is a problem with sending an undefined
userId. Hope this explain the case better!
Apologize in advance if this turns out to be a fake alarm!
Thanks for the extra context! It's easier to have it here than in the slack thread, indeed!
You've already heard from several of the team members that yeah, those numbers look mighty skewed, so there's nothing new I can tell you there.
The feature flag above is used on a step in our funnel where a user is not created yet and so the first time updateContext is called, should be called with {userId: undefined}
So the first time it's called, it's called with an undefined userId, but later on, the ID should be defined right?
I know you already checked the query parameters in the thread, but could I ask you to double check that it does not send a userId
parameter when you set userId
to undefined
? At least as far as I can understand, that could rule out the "undefined might be stringified" hypothesis. As I said, the tests I added in #147 do not add that query param to url.
I'm actually beginning to think that this might be something that's happening on the Proxy and not in the client. But I know you talked a bit about that in the thread too (with the 500 curl requests and all) 🤔
I know you already checked the query parameters in the thread, but could I ask you to double check that it does not send a userId parameter when you set userId to undefined? At least as far as I can understand, that could rule out the "undefined might be stringified" hypothesis. As I said, the tests I added in https://github.com/Unleash/unleash-proxy-client-js/pull/147 do not add that query param to url.
I am confirming that the userId
parameter has not been sent while the userId
is undefined
.
I'm actually beginning to think that this might be something that's happening on the Proxy and not in the client. But I know you talked a bit about that in the thread too (with the 500 curl requests and all) 🤔
True, I made some curl requests, but I haven't added any context to the requests. Those tests seemed to work fine - always returning the same result
I am confirming that the userId parameter has not been sent while the userId is undefined.
Thank you! 😄
True, I made some curl requests, but I haven't added any context to the requests. Those tests seemed to work fine - always returning the same result
Yeah, great. And I think it was suggested that remoteAddress
might be the reason behind that.
Anyway, thanks for all the information! I don't think we can do anything about it this week, but I'll bring it up for next week's planning, so we'll probably do some more digging then.
Hey, @SimeonKostov! So we've talked about this a little bit internally, but unfortunately we haven't been able to reproduce it. The issue seems serious, but because no one else has reported this, it seems probably that the issue is on your end.
Can you reproduce this with a completely clean Unleash setup running locally as well?
If you could provide us with a reproducible example, then we'd be more than happy to have a look at it, but without that, there's not much more we can do here, I'm afraid.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
@sighphyre Didn't you find out what the cause of this was? Has that change propagated to the Proxy?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Describe the bug
In our React app, we had been updating the Unleash context's
userId
field in the following way:until we noticed that there was an issue with the variant splitting for one of our feature flags - a flag with
control
andchallenger
variants, each with 50% weight.Initially, the userId is
undefined
until an account is created, and seems like theundefined
value is sent to the context as a string because the splitting issue is just for a single flag used before an account is created.Steps to reproduce the bug
undefined
to theuserId
context fieldExpected behavior
When a
userId
is undefined in the context, asessionId
should be used in order to distinguish the different users calling the proxy/server.Logs, error output, etc.
No response
Screenshots
No response
Additional context
No response
Unleash version
unleashorg/unleash-proxy:v0.11.7
Subscription type
Pro
Hosting type
Hosted by Unleash
SDK information (language and version)
@unleash/proxy-client-react v3.5.1, unleash-proxy-client v2.4.2