Skip to content

Use live data on InvestigationsOverviewPage - #4218

Merged
jschuurk-kr merged 3 commits into
mainfrom
use-live-data-on-investigations-overview
Nov 2, 2026
Merged

jschuurk-kr merged 3 commits into
mainfrom
use-live-data-on-investigations-overview

Conversation

@jschuurk-kr

@jschuurk-kr jschuurk-kr commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

What & why

While testing PR #4190 I discovered that in some situations the modal shown when deleting an investigation does not contain the warning that the related data entry will also be removed. Reason is that we only fetch the data entry states when landing on the investigations overview page. So if a typist starts data entry and the coordinator removes the investigation before returning to the investigations overview page, the coordinator is not informed that removing the investigation will also remove the data entry.

There's also the similar scenario in which a typist deletes their data entry and the coordinator deletes the investigation before the data entry status is refreshed. In that case the coordinator does see the warning when they shouldn't.

I opted to solve this by making the investigations overview page use our useLiveData hook instead of only re-fetching when the component mounts. Three reasons for this:

  1. It solves most occurrences of the scenarios above, assuming that coordinators are most likely to trigger the scenario by staying for a while on the investigations overview page and then clicking an investigation to remove it.
  2. We show the data entry status on the investigations overview page. So it's odd not to auto-refresh this page like we do with the data entry status page.
  3. It's a small change.

How to test

Coordinator - typist:

  1. Go to the investigations overview page.
  2. Make sure there is an investigation for which data entry has not started yet.
  3. In a separate session, as typist start the data entry for the investigation.
  4. See the investigation overview page fetch the status data and update the page.

Coordinator - coordinator:

  1. Go to the investigations overview page with two coordinators in two browsers.
  2. Add an investigation. Edit it etc. with one of the coordinators.
  3. Check if the data shown to the other coordinator is updated automatically.

Optionally, also try deleting the investigation at various points and check the modal for the text "Let op: De gecorrigeerde telresultaten die al zijn ingevoerd worden ook verwijderd."

Reviewer notes

I looked at the ElectionStatusPage component and useLiveData function to make sure the only change is that the page now also auto-refreshes. Please check that is indeed the case.

@jschuurk-kr jschuurk-kr self-assigned this Oct 30, 2026
@jschuurk-kr
jschuurk-kr requested a review from a team as a code owner October 30, 2026 16:17
@jschuurk-kr jschuurk-kr added needs-backport/1.2 Needs backporting to the 1.2 release branch frontend Issues or pull requests that relate to the frontend labels Oct 30, 2026
@jschuurk-kr

Copy link
Copy Markdown
Contributor Author

Several tests in InvestigationsOverviewPage.test.tsx fail, presumably because of the overrideOnce() on "/api/elections/1" which means a second request due to using live data does not get the mocked response.

@jschuurk-kr
jschuurk-kr marked this pull request as ready for review November 2, 2026 12:21
@jschuurk-kr
jschuurk-kr requested a review from a team November 2, 2026 12:21
@jschuurk-kr
jschuurk-kr added this pull request to the merge queue Nov 2, 2026
Merged via the queue into main with commit 0753dd1 Nov 2, 2026
23 checks passed
@jschuurk-kr
jschuurk-kr deleted the use-live-data-on-investigations-overview branch November 2, 2026 13:19

This branch was successfully deployed

1 active deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

frontend Issues or pull requests that relate to the frontend needs-backport/1.2 Needs backporting to the 1.2 release branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants