statsig-io / ios-sdk

Statsig's SDK for client-side iOS applications.
ISC License
15 stars 8 forks source link

Parameter stores not generating usable ids for feature gate keys? #18

Closed jamstop closed 2 months ago

jamstop commented 2 months ago

Hey hey, I'm running into an issue getting a proper response out of parameterStore.getValue(forKey:). The call is failing to find the hashed gate number in https://github.com/statsig-io/ios-sdk/blob/ee0c395444bb12ea0aa44a1c30ddb4c4a3a6d8d7/Sources/Statsig/InternalStore.swift#L60.

I've noticed that the gate key stored in the parameterStore never exists in the gates in cache. It seems like the parameterStore gate key isn't being hashed properly / using the same hash.

I've tried:

The gate definitely exists, and checkGate works perfectly. It's just the key stored in the ParameterStore object is not valid.

Parameter stores are a great idea and we really wanted to use them. Would love to know what's going on / if you guys have it working with gates

tore-statsig commented 2 months ago

Thanks for the report, we will take a look. Could you provide the project id (from the url in console), parameter store name, and parameter/gate name?

Are you using target apps?

jamstop commented 2 months ago

Not using target apps. The project id (org id?) is 64RBMXCoSmsTc9oTU9ghAk, the parameter store name is suno-ios, and the parameter/gate name is contact_sync_enabled and contact-sync-ios.

tore-statsig commented 2 months ago

Thanks for that. We've root caused the issue and will be able to deploy a patch via our servers - the ios library should be working fine, but its getting a bad mapping

jamstop commented 2 months ago

Ah gotcha, thanks! Let me know once the change is through :+1:

tore-statsig commented 2 months ago

Okay the fix is rolled out. The other thing you will notice is a change in the the console to display parameter names - they arent actually auto-cast to lower_case_with_underscores at the moment, so make sure you access the correct parameter name ("contact sync enabled" in this case)