Repository navigation
fix(ui): handle rejected document uploads without fetch error page (REGBACKLOG-476) - #1938
Merged
Merged
Conversation
…EGBACKLOG-476) - examiner: stop rethrowing upload errors from the document store; the error modal is already shown and the rethrow escaped through emit() into Nuxt's global error handler, showing the "Fetch Error" page - host/strata: removeStoredDocument returns early when the doc isn't in the list, so a rejected dashboard upload no longer splices(-1) the last stored document (and, on host, saves a draft without it)
panish16
requested review from
jimmypalelil and
severinbeauvais
as code owners
November 27, 2026 01:05
Collaborator
|
Temporary Url for review: https://strr-strata-hotel-dev--pr-1938-4j4maije.web.app |
Collaborator
|
Temporary Url for review: https://strr-examiner-dev--pr-1938-kqjlqgjc.web.app |
Collaborator
|
Temporary Url for review: https://strr-hosts-dev--pr-1938-otwohg7o.web.app |
panish16
added a commit
that referenced
this pull request
Nov 27, 2026
- base: guard removeDocumentFromList against index -1 (bump base to 0.0.64) - examiner: JSDoc says upload fns always resolve; add addDocumentToApplication failure test - strata: add rejected dashboard upload test (list unchanged, no DELETE)
…76) (#1939) * chore(ui): bump examiner, host and strata versions (REGBACKLOG-476) * fix(ui): drop removeStoredDocument from failed dashboard upload catch (REGBACKLOG-476) The doc is only pushed to storedDocuments as the last step of the try, so on failure there is nothing to remove. Calling it with a doc not in the list hit splice(-1, 1) and dropped the last stored doc. Replaces the index === -1 guard (Sonar flagged the duplicated guard in host/strata). * fix(ui): address #1938 review (REGBACKLOG-476) - base: guard removeDocumentFromList against index -1 (bump base to 0.0.64) - examiner: JSDoc says upload fns always resolve; add addDocumentToApplication failure test - strata: add rejected dashboard upload test (list unchanged, no DELETE) * fix(ui): keep the not-found guard in removeStoredDocument (REGBACKLOG-476) findIndex returns -1 for a doc that's not in the list (double click on remove, or removed while its upload was still running), and splice(-1, 1) then drops the last real document. Return early in host and strata, with a regression test in each.
|
Collaborator
|
Temporary Url for review: https://strr-strata-hotel-dev--pr-1938-4j4maije.web.app |
Collaborator
|
Temporary Url for review: https://strr-examiner-dev--pr-1938-kqjlqgjc.web.app |
Collaborator
|
Temporary Url for review: https://strr-hosts-dev--pr-1938-otwohg7o.web.app |
severinbeauvais
approved these changes
Nov 28, 2026
This branch was previously deployed
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.



Issue:
Description of changes:
BaseUploadAdditionalDocumentscallsawait emit('uploadDocument', ...), andemitdoesn't return the handler's promise, so the rethrown error went unhandled into Nuxt's global error handler and showed the full-page "Fetch Error". Host and strata already swallow it after the modal. This path only became reachable after feat(upload): enhance document upload validation for PDF and JPEG for… #1905, because the API now rejects files whose contents don't match the declared type (e.g. a PDF renamed to.jpg).addDocumentcallsremoveStoredDocumentfor a doc that was never added tostoredDocuments.findIndexreturned-1, andsplice(-1, 1)removed the last real document from the list. On host it then also saves a draft whenpermit.applicationis loaded. Fixed in fix(ui): simplify failed-upload cleanup + version bumps (REGBACKLOG-476) #1939 (stacked into this branch): the failed-uploadcatchno longer callsremoveStoredDocument, since the doc was never added. This replaced anindex === -1guard that SonarCloud flagged as duplicated code.How this was tested:
store-document.spec.ts(upload failure now resolves and still shows the modal). Lint passes; 310 pass, 8 skipped.store-document.spec.ts. It fails without the fix and passes with it. Lint passes; 344/344 pass.use-filing-history.spec.ts(examiner) andstrata-formatting.spec.ts(strata) sometimes time out in a setup hook locally. That happens on clean main too, unrelated to this change..pdf.jpgas "Property tax notice". API returned 400File contents do not match the file type 'image/jpeg'(POST /registrations/359/documentsin strr-api-dev logs). Only the error modal showed: no Fetch Error, no refresh needed, all 5 existing docs still listed.await emitproblem. Checking with Pam on the Jira ticket whether that's OK for the "remains on the upload page" acceptance criterion.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the BC Registry and Digital Services BSD 3-Clause License