amplitude / experiment-js-client

Amplitude Experiment client-side SDK for JavaScript
MIT License
8 stars 7 forks source link

Inconsistent behavior: initial variants are treated as fallback when source is local storage #94

Closed helloendoftheworld closed 9 months ago

helloendoftheworld commented 11 months ago

Initial variants are fallback when source is local storage, disabling automatic exposure. However, local storage variants are not fallback when source is initial variants. Is there a reason for that?

https://github.com/amplitude/experiment-js-client/blob/3d6f5ba82e6f4eef23e5977ed2288cd83bc74627/packages/experiment-browser/src/types/source.ts#L50

tyiuhc commented 11 months ago

Hi @SherifGhoz, many thanks for your question. Local storage variants are always fetched variants (via remote evaluation), and thus not considered fallbacks. Some additional context for expected behavior, happy to provide additional clarification if needed!