Skip to content

fix(ui): simplify failed-upload cleanup + version bumps (REGBACKLOG-476) - #1939

Merged
panish16 merged 4 commits into
feature-REGBACKLOG-476-upload-errorfrom
chore/regbacklog-476-version-bump
Nov 27, 2026
Merged

panish16 merged 4 commits into
feature-REGBACKLOG-476-upload-errorfrom
chore/regbacklog-476-version-bump

Conversation

@panish16

@panish16 panish16 commented Nov 27, 2026 •

Copy link
Copy Markdown
Collaborator

Issue:

Description of changes:

Follow-up to #1938. That PR's head is a protected feature branch, so changes go in through this PR.

  • host-pm-web / strata-web: replaces the index === -1 guard in removeStoredDocument (SonarCloud failed fix(ui): handle rejected document uploads without fetch error page (REGBACKLOG-476) #1938 on 25% duplicated new code because the guard was identical in both apps). The failed-upload catch in host addDocument and strata addDocumentToApplication no longer calls removeStoredDocument. The doc is only pushed to storedDocuments as the last step of the try, so on failure there's nothing to remove, and calling it is what hit splice(-1, 1) and dropped the last real doc. Against main, the change in each file is now just that one deleted line.
  • Version bumps: examiner 0.2.72 → 0.2.73, host 1.3.38 → 1.3.39, strata 1.2.14 → 1.2.15.
  • Review fixes from fix(ui): handle rejected document uploads without fetch error page (REGBACKLOG-476) #1938 (Severin):
    • base-web: removeDocumentFromList in BaseUploadAdditionalDocuments now guards against index === -1, which had the same splice(-1) bug. Base bumped 0.0.63 → 0.0.64. The apps build against strr-base-web#main, so this takes effect after merge.
    • examiner-web: JSDoc for both upload functions now says they always resolve and show errors in a modal. Added a failure test for addDocumentToApplication.
    • strata-web: added a rejected dashboard upload test (existing doc kept, no DELETE).

How this was tested:

  • Unit / integration tests run: lint passes in base, examiner, host and strata. Full unit suites: base 89/89, host 344/344, examiner 311 pass / 8 skipped, strata 50 pass / 13 skipped. use-filing-history.spec.ts and strata-formatting.spec.ts sometimes time out in a setup hook; that happens on clean main too. The new examiner and strata failure tests and the host regression test all fail against main's code and pass with these changes.
  • Manual / local / DB verification: after this merges into the feature branch, dev will redeploy and I'll re-run the host upload test from fix(ui): handle rejected document uploads without fetch error page (REGBACKLOG-476) #1938 (H178304639, PDF renamed to .jpg).

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

@bcregistry-sre

Copy link
Copy Markdown
Collaborator

Temporary Url for review: https://strr-hosts-dev--pr-1939-m20kip2b.web.app

… (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).
@panish16 panish16 changed the title chore(ui): bump examiner, host and strata versions (REGBACKLOG-476) fix(ui): simplify failed-upload cleanup + version bumps (REGBACKLOG-476) Nov 27, 2026
@bcregistry-sre

Copy link
Copy Markdown
Collaborator

Temporary Url for review: https://strr-hosts-dev--pr-1939-m20kip2b.web.app

Comment thread strr-host-pm-web/app/stores/document.ts Resolved
- 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)
@bcregistry-sre

Copy link
Copy Markdown
Collaborator

Temporary Url for review: https://strr-hosts-dev--pr-1939-m20kip2b.web.app

Comment thread strr-host-pm-web/app/stores/document.ts Resolved
Comment thread strr-strata-web/app/stores/document.ts Resolved
…-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.
@sonarqubecloud

Copy link
Copy Markdown

@bcregistry-sre

Copy link
Copy Markdown
Collaborator

Temporary Url for review: https://strr-hosts-dev--pr-1939-m20kip2b.web.app

@severinbeauvais severinbeauvais left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

Keeping the guard as an early return in each app is a good compromise, given that base-web has to merge before the apps can use anything new from it.

@panish16
panish16 merged commit 0d80045 into feature-REGBACKLOG-476-upload-error Nov 27, 2026
40 checks passed
panish16 added a commit that referenced this pull request Nov 28, 2026
…EGBACKLOG-476) (#1938)

* fix(ui): handle rejected document uploads without fetch error page (REGBACKLOG-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)

* fix(ui): simplify failed-upload cleanup + version bumps (REGBACKLOG-476) (#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.
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.

3 participants