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: last seen survey date logic #1745

Merged
merged 1 commit into from
Feb 18, 2025
Merged

Conversation

lucasheriques
Copy link
Contributor

Changes

currently, if you set up a survey to wait for 1 day to show again, it'll be displayed straight way.

that's because the logic that tests this case is wrong - if only 5 minutes have passed, it'll still render it.

So I extracted that logic into a separate function to fix the logic and make it easier to create tests for it
...

Checklist

  • Tests for new code (see advice on the tests we use)
  • Accounted for the impact of any changes across different browsers
  • Accounted for backwards compatibility of any changes (no breaking changes in posthog-js!)

@lucasheriques lucasheriques self-assigned this Feb 18, 2025
@lucasheriques lucasheriques requested a review from a team as a code owner February 18, 2025 01:42
Copy link

vercel bot commented Feb 18, 2025

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

Name Status Preview Updated (UTC)
posthog-js ✅ Ready (Inspect) Visit Preview Feb 18, 2025 1:44am

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here: app.greptile.com/review/github.

3 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile

Copy link

Size Change: +172 B (+0.01%)

Total Size: 3.31 MB

Filename Size Change
dist/all-external-dependencies.js 216 kB +24 B (+0.01%)
dist/array.full.es5.js 269 kB +28 B (+0.01%)
dist/array.full.js 372 kB +24 B (+0.01%)
dist/array.full.no-external.js 370 kB +24 B (+0.01%)
dist/module.full.js 372 kB +24 B (+0.01%)
dist/module.full.no-external.js 370 kB +24 B (+0.01%)
dist/surveys.js 72.8 kB +24 B (+0.03%)
ℹ️ View Unchanged
Filename Size
dist/array.js 184 kB
dist/array.no-external.js 182 kB
dist/customizations.full.js 14 kB
dist/dead-clicks-autocapture.js 14.5 kB
dist/exception-autocapture.js 9.51 kB
dist/external-scripts-loader.js 2.64 kB
dist/main.js 185 kB
dist/module.js 184 kB
dist/module.no-external.js 182 kB
dist/recorder-v2.js 115 kB
dist/recorder.js 115 kB
dist/surveys-preview.js 69.7 kB
dist/tracing-headers.js 1.76 kB
dist/web-vitals.js 10.4 kB

compressed-size-action

@lucasheriques lucasheriques added the bump patch Bump patch version when this PR gets merged label Feb 18, 2025
Copy link
Member

@marandaneto marandaneto left a comment

Choose a reason for hiding this comment

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

looks solid

@marandaneto marandaneto merged commit 51c68a7 into main Feb 18, 2025
32 checks passed
@marandaneto marandaneto deleted the fix/last-seen-survey-date-logic branch February 18, 2025 06:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bump patch Bump patch version when this PR gets merged feature/surveys
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants