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

Faster alerts fetching #314

Closed
wants to merge 2 commits into from
Closed

Faster alerts fetching #314

wants to merge 2 commits into from

Conversation

martindstone
Copy link

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.

@gsreynolds gsreynolds modified the milestones: v0.10.1, v0.10.2 Sep 14, 2023
@gsreynolds gsreynolds modified the milestones: v0.10.2, v0.11.0 Oct 4, 2023
Copy link
Member

@gsreynolds gsreynolds left a 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

Comment on lines -379 to -388
useEffect(() => {
if (inView) {
if (!row.original.alerts) {
getIncidentAlerts(row.original.id);
}
if (!row.original.notes) {
getIncidentNotes(row.original.id);
}
}
}, [inView]);
Copy link
Member

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]);

@martindstone
Copy link
Author

I am gonna make this a draft and rebase and fix some things...

@gsreynolds gsreynolds reopened this Oct 5, 2023
@gsreynolds gsreynolds marked this pull request as draft October 5, 2023 08:57
@gsreynolds gsreynolds modified the milestones: v0.11.0, v0.12.0 Nov 16, 2023
@martindstone martindstone deleted the faster-alerts branch January 30, 2024 20:41
@gsreynolds gsreynolds removed this from the v0.12.0 milestone Feb 15, 2024
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