-
Notifications
You must be signed in to change notification settings - Fork 3
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
Faster alerts fetching #314
Conversation
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.
Need to resolve merge conflict / preserve alert count fix change from #321
useEffect(() => { | ||
if (inView) { | ||
if (!row.original.alerts) { | ||
getIncidentAlerts(row.original.id); | ||
} | ||
if (!row.original.notes) { | ||
getIncidentNotes(row.original.id); | ||
} | ||
} | ||
}, [inView]); |
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.
@martindstone - need to review this as the change we did to fix the alert count in #321 was implemented here in this useEffect
, but it's removed in this PR. Is it handled elsewhere instead?
useEffect(() => {
if (inView) {
if (
!row.original.alerts
|| (Array.isArray(row.original.alerts) && row.original.alerts.length !== row.original.alert_counts?.all)
) {
getIncidentAlerts(row.original.id);
}
if (!row.original.notes) {
getIncidentNotes(row.original.id);
}
}
}, [inView]);
I am gonna make this a draft and rebase and fix some things... |
This PR updates the alerts and notes fetching to use the new endpoints implemented for PDlive. Notes and alerts fetching is much faster, and there is no longer any need for intersection observer or lazy loading, so a bunch of hacky stuff can be removed.