Skip to content
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

fix: second evaluation would have cache #2882

Merged
merged 3 commits into from
Mar 28, 2024
Merged

Conversation

rebelchris
Copy link
Contributor

@rebelchris rebelchris commented Mar 28, 2024

Changes

Describe what this PR does

  • We had a small issue with onboarding if you where in the experiment, then complete onboarding the shouldEvaluate becomes false, but it would not retrigger unless you did a hard refresh on the page.
  • This introduces a second trigger to always return false when already evaluated and this value changes

Events

Did you introduce any new tracking events?
Don't forget to update the Analytics Taxonomy sheet

Log the new/changed events below:

Type event_name value
Change/New event name extra: { ... }

Please make sure existing components are not breaking/affected by this PR

Manual Testing

On those affected packages:

  • Have you done sanity checks in the webapp?
  • Have you done sanity checks in the extension?
  • Does this not break anything in companion?

Did you test the modified components media queries?

  • MobileL (420px)
  • Tablet (656px)
  • Laptop (1020px)

Did you test on actual mobile devices?

  • iOS (Chrome and Safari)
  • Android

WT-{number} #done

Preview domain

https://fix-second-eval-fix.preview.app.daily.dev

Copy link

vercel bot commented Mar 28, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
daily-webapp ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 28, 2024 4:23pm
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
storybook ⬜️ Ignored (Inspect) Mar 28, 2024 4:23pm

Comment on lines 37 to 39
if (!shouldEvaluate) {
return false as WidenPrimitives<T>;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about features that are not bool?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can change it to the default value, would that make more sense I guess?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, just to support other feature flags in this hook.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@capJavert Although, at some point we might change default to true, and then you get this experiment forever.
But guess once we hit that we can add something like valueWhenNotEvaluated or something.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, don't know at top of my head, but sounds complicated and yes something to evaluate for future usage of the hook.

Copy link
Contributor

@capJavert capJavert Mar 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Basically just returning something that GB does not return feels wrong right? We should hide the added UI in regards to something else and feature value should always be what GB returns, in this case "true" if user is part of experiment.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah correct, for this flow it's fine, but can imagine there might be something where it won't work ilke this.
There we could potentially use the initial evaluation for rendering determination.

@rebelchris rebelchris requested a review from capJavert March 28, 2024 16:18
@rebelchris rebelchris merged commit db06c42 into main Mar 28, 2024
10 checks passed
@rebelchris rebelchris deleted the fix-second-eval-fix branch March 28, 2024 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants