-
Notifications
You must be signed in to change notification settings - Fork 2k
fix: only reload query when events are added / changed (not all removed) #39895
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
base: master
Are you sure you want to change the base?
Conversation
Size Change: 0 B Total Size: 3.3 MB ℹ️ View Unchanged
|
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.
2 files reviewed, 2 comments
if (params.events && !equal(params.events, values.events)) { | ||
actions.setEvents(params.events) | ||
} |
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.
style: potential desync if URL parameter is manually removed
the condition only checks if params.events
exists, so if a user has events selected and then manually removes the events
param from the URL, the state won't reset to null
. consider handling the undefined case:
if (params.events && !equal(params.events, values.events)) { | |
actions.setEvents(params.events) | |
} | |
if (!equal(params.events ?? null, values.events)) { | |
actions.setEvents(params.events ?? null) | |
} |
Prompt To Fix With AI
This is a comment left during a code review.
Path: products/error_tracking/frontend/scenes/ErrorTrackingScene/tabs/impact/errorTrackingImpactListLogic.tsx
Line: 128:130
Comment:
**style:** potential desync if URL parameter is manually removed
the condition only checks if `params.events` exists, so if a user has events selected and then manually removes the `events` param from the URL, the state won't reset to `null`. consider handling the undefined case:
```suggestion
if (!equal(params.events ?? null, values.events)) {
actions.setEvents(params.events ?? null)
}
```
How can I resolve this? If you propose a fix, please make it concise.
if (params.activeTab && !equal(params.activeTab, values.activeTab)) { | ||
actions.setActiveTab(params.activeTab) | ||
} |
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.
style: potential desync if URL parameter is manually removed
the condition only checks if params.activeTab
exists, so if someone manually removes the activeTab
param from the URL, the state won't reset to the default. consider handling the undefined case:
if (params.activeTab && !equal(params.activeTab, values.activeTab)) { | |
actions.setActiveTab(params.activeTab) | |
} | |
if (!equal(params.activeTab ?? DEFAULT_ACTIVE_TAB, values.activeTab)) { | |
actions.setActiveTab(params.activeTab ?? DEFAULT_ACTIVE_TAB) | |
} |
Prompt To Fix With AI
This is a comment left during a code review.
Path: products/error_tracking/frontend/scenes/ErrorTrackingScene/errorTrackingSceneLogic.ts
Line: 137:139
Comment:
**style:** potential desync if URL parameter is manually removed
the condition only checks if `params.activeTab` exists, so if someone manually removes the `activeTab` param from the URL, the state won't reset to the default. consider handling the undefined case:
```suggestion
if (!equal(params.activeTab ?? DEFAULT_ACTIVE_TAB, values.activeTab)) {
actions.setActiveTab(params.activeTab ?? DEFAULT_ACTIVE_TAB)
}
```
How can I resolve this? If you propose a fix, please make it concise.
Problem
Addresses all the feedback in https://posthog.slack.com/archives/C07AA937K9A/p1759420827044679
Changes