Skip to content

fix: show what went wrong on canvas error screens - #379

Merged
HendrikThePendric merged 7 commits into
masterfrom
fix/vis-not-found-error
Sep 17, 2026
Merged

HendrikThePendric merged 7 commits into
masterfrom
fix/vis-not-found-error

Conversation

@HendrikThePendric

@HendrikThePendric HendrikThePendric commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator

Implements N/A

Description

Loading a non-existent visualization showed "Something went wrong" with a Retry that could never succeed — there was no not-found case in the error mapping.

Fixing that exposed a bigger problem. Analytics rejects a bad request with HTTP 409, and data-engine types 401, 403 and 409 alike as access. So every analytics code we had no specific error screen for told the user "Restricted access — contact a system administrator", sending them to their sysadmin over an app bug.

Changes

  • E1005 gets a "Visualization not found" screen, with copy reused from line-listing-app so it inherits the translations.
  • The access branch now splits on whether the error names a code. A code means the backend refused the request, so the screen shows the server's message; no code means a real 401/403 and keeps the access text.
  • Named screens for nine codes a user can hit without the app being able to prevent it: stale metadata (E7222–E7226, E7236, E7245, E7142) and queries that are too big or too slow (E7128, E7131, E7209).
  • Titles now name the problem instead of "Something went wrong", which also reworded E7132, E7144 and E7145. A test keeps the catch-all title on the catch-all only.
  • Icons follow one rule: database when the data or its metadata is the problem, warning triangle when the request or the system failed.
  • Retry only where retrying can work — E7131 yes, E7128 no.

Unit tests cover the mapping; canvas-error.cy.tsx renders all 18 screens for visual review.


Quality checklist

  • Cypress and/or Jest tests added/updated
  • Docs added N/A
  • d2-ci dependency replaced N/A

@dhis2-bot

Copy link
Copy Markdown
Contributor

🚀 Deployed on https://pr-379.event-visualizer.netlify.dhis2.org

@dhis2-bot
dhis2-bot temporarily deployed to netlify September 10, 2026 15:11 Inactive
@dhis2-bot
dhis2-bot temporarily deployed to netlify September 11, 2026 07:31 Inactive
Comment thread src/modules/error/error-codes.ts Outdated
Comment thread src/modules/error/error-codes.ts Outdated
Co-authored-by: Joe Cooper <33054985+cooper-joe@users.noreply.github.com>
@dhis2-bot
dhis2-bot temporarily deployed to netlify September 15, 2026 12:15 Inactive
@cooper-joe
cooper-joe self-requested a review September 16, 2026 06:36
cooper-joe
cooper-joe previously approved these changes Sep 16, 2026
@dhis2-bot
dhis2-bot temporarily deployed to netlify September 16, 2026 14:56 Inactive
HendrikThePendric and others added 2 commits September 17, 2026 14:36
Running the project formatter fixed a stray double-quoted string in
error-codes.ts to match the single-quote convention. No test text
mismatches resulted, since the formatting change didn't alter string
content.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
pnpm test (vitest) doesn't run .cy.tsx Cypress component specs, so the
error-screen copy update in this branch went unverified against them.
Running pnpm cy:comp:run against this file surfaced two failing
assertions still checking the old E7123 and E7128 description text.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@sonarqubecloud

Copy link
Copy Markdown

@HendrikThePendric
HendrikThePendric merged commit 04afda2 into master Sep 17, 2026
17 checks passed
@HendrikThePendric
HendrikThePendric deleted the fix/vis-not-found-error branch September 17, 2026 13:44
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.

4 participants