Improve update polling for assessments#8102
Merged
lucanovera merged 2 commits intoMay 4, 2026
Merged
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
galvana
approved these changes
May 4, 2026
Contributor
Author
|
@galvana I made this PR in response to your earlier feedback about needing a refresh of the page to see the results. This simplifies the logic and instead of looking at counts, it just refreshes the list results every 15s if there is an active task running. |
galvana
pushed a commit
that referenced
this pull request
May 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ticket ENG-3531
Description Of Changes
Follow-up to #8041. With realistic LLM call durations (a few minutes per declaration), the privacy assessments list still didn't update until the first LLM call finished — so users could wait 3+ minutes after clicking "Generate" before any cards appeared, even though the materialized
generatingrows existed in the DB within ~2 seconds of trigger.The original implementation looked for chang
This PR replaces both refetch triggers with a single polling subscription on the assessments list query, gated on the same
!activeTaskcondition as the existing tasks polling. The page'suseGetPrivacyAssessmentsQuery()shares the RTK cache key, so the list re-renders automatically when the indicator's polling fills the cache. Time-to-first-card drops from ~3 min to ~15s.Code Changes
clients/admin-ui/src/features/privacy-assessments/AssessmentTaskStatusIndicator.tsx:useGetPrivacyAssessmentsQuery(undefined, { pollingInterval: 15s, skip: !activeTask })subscription that mirrors the existing tasks-polling cadence.prevCompletedCountRefeffect (count-delta refetch trigger).prevActiveTaskIdRef/hasObservedActiveTaskRefeffect (one-shot refetch on task start).completedCountderivation.hadActiveTaskRef(active → idle) effect with itsonTaskFinish?.()call: the polling subscription stops the momentactiveTaskbecomes null, and the task's transition tocompletehappens in the same Celery commit as the last row's status flip. Without an explicit final refetch, ~50% of runs would leave one card showing stale state. The active → idle effect plugs that hole.pages/privacy-assessments/index.tsx. ItsonTaskFinish={refetchAssessments}wiring is what the active → idle effect calls — kept as-is.Steps to Confirm
time.sleep(30)in the LLM path) so each declaration takes well over 15s.Generating...cards appear in the list (no manual refresh needed).generatingrows are cleared (handled by the fidesplus side from Improve progress feedback on assessment evaluation #8041)./privacy-assessments. Network tab should show the initial list fetch only — no further polling while idle (skip: !activeTaskkeeps the subscription dormant).Pre-Merge Checklist
CHANGELOG.mdupdatedmaindowngrade()migration is correct and works