Skip to content

Bugfix/handle errors in file upload 2#280

Closed
mokhld wants to merge 1 commit intobugfix/handle-errors-in-file-uploadfrom
bugfix/handle-errors-in-file-upload-2
Closed

Bugfix/handle errors in file upload 2#280
mokhld wants to merge 1 commit intobugfix/handle-errors-in-file-uploadfrom
bugfix/handle-errors-in-file-upload-2

Conversation

@mokhld
Copy link
Copy Markdown
Contributor

@mokhld mokhld commented Dec 16, 2025

Proposed change

Jira ticket:

Type of change

  • Bug fix
  • New feature
  • Breaking change
  • Misc. (documentation, build updates, etc)

Checklist

  • You have executed this code locally and it performs as expected.
  • You have added tests to verify your code works.
  • You have added code comments and JSDoc, where appropriate.
  • There is no commented-out code.
  • You have added developer docs in README.md and docs/* (where appropriate, e.g. new features).
  • The tests are passing (npm run test).
  • The linting checks are passing (npm run lint).
  • The code has been formatted (npm run format).

@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 90%)

See analysis details on SonarQube Cloud

@alexluckett alexluckett changed the base branch from main to bugfix/handle-errors-in-file-upload December 16, 2025 15:03
)

request.yar.flash(COMPONENT_STATE_ERROR, govukError, true)
await request.yar.commit(h as ResponseToolkit)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

duh, don't know what I wanted to put this into context.js 🤦

thanks!

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I remembered now. It's because yar needs to commit the internal clear operation when yar.flash(key) is called. Otherwise the error will always show and never disappear.

@alexluckett
Copy link
Copy Markdown
Contributor

Closing this as unfortunately it doesn't work in this scenario

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.

2 participants