-
Notifications
You must be signed in to change notification settings - Fork 145
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: check url match twice because of potential race condition #1722
fix: check url match twice because of potential race condition #1722
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
This PR adds a defensive URL matching check to prevent race conditions in survey rendering. Here's a concise summary of the key changes:
- Added secondary URL match verification in
handlePopoverSurvey
method before rendering surveys - Prevents edge case where URL changes between initial survey matching and actual rendering
- Ensures surveys only display when URL conditions are still valid at render time
- Maintains backward compatibility while improving reliability of URL-based survey targeting
The change is focused and targeted at preventing incorrect survey displays due to timing issues between URL checks and rendering.
1 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile
Size Change: +33 B (0%) Total Size: 3.3 MB
ℹ️ View Unchanged
|
Changes
Also checks if the URL condition is matching before actually rendering it.
This is to test wether or not there's some sort of race condition where the survey is rendered on the correct URL, but the URL changes, and before we process that, the survey is already rendered.
Instance event where it happened. Survey is set to not sohw up in this event, but it did.
...
Checklist