Skip to content

Commit

Permalink
Merge pull request #6903 from opengovsg/release-v6.89.1
Browse files Browse the repository at this point in the history
fix: hotfix v6.89.1 for proper error handling in encrypt-submission middleware
  • Loading branch information
wanlingt authored Nov 16, 2023
2 parents 6ee4b2d + fb415fc commit 9767656
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 34 deletions.
10 changes: 7 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,18 @@ All notable changes to this project will be documented in this file. Dates are d

Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

#### [v6.89.0](https://github.com/opengovsg/FormSG/compare/v6.89.0...v6.89.0)
#### [v6.89.1](https://github.com/opengovsg/FormSG/compare/v6.89.0...v6.89.1)

- fix: add learn more link [`#6897`](https://github.com/opengovsg/FormSG/pull/6897)
- build: release v6.89.0 [`#6898`](https://github.com/opengovsg/FormSG/pull/6898)
- fix: remove myinfo child from storage mode [`#6901`](https://github.com/opengovsg/FormSG/pull/6901)
- fix: add error handling [`d6c4985`](https://github.com/opengovsg/FormSG/commit/d6c4985aa8e35dd2278af9b70d00d4e86a48bde1)
- fix: remove email mode from myinfo limit message [`5a45c98`](https://github.com/opengovsg/FormSG/commit/5a45c980dbe3fc8c15eacb3ff1827f3003fcbfc4)

#### [v6.89.0](https://github.com/opengovsg/FormSG/compare/v6.88.0...v6.89.0)

> 15 November 2023

- fix: add learn more link [`#6897`](https://github.com/opengovsg/FormSG/pull/6897)
- chore: security upgrade axios to 1.6.2 [`#6893`](https://github.com/opengovsg/FormSG/pull/6893)
- feat: myinfo for storage-mode [`#6870`](https://github.com/opengovsg/FormSG/pull/6870)
- feat: announcement modal and what's new for myinfo storage-mode [`#6892`](https://github.com/opengovsg/FormSG/pull/6892)
Expand All @@ -22,7 +26,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
- fix(deps): bump type-fest from 4.5.0 to 4.7.1 in /shared [`#6883`](https://github.com/opengovsg/FormSG/pull/6883)
- build: merge release 6.88.0 into develop [`#6882`](https://github.com/opengovsg/FormSG/pull/6882)
- build: release v6.88.0 [`#6881`](https://github.com/opengovsg/FormSG/pull/6881)
- chore: bump version to v6.89.0 [`e511d27`](https://github.com/opengovsg/FormSG/commit/e511d27cee4cf0ad5f5687046dfb25577125942d)
- chore: bump version to v6.89.0 [`1665a48`](https://github.com/opengovsg/FormSG/commit/1665a48b0ff133378c7126d3fedf8f1145f67111)

#### [v6.88.0](https://github.com/opengovsg/FormSG/compare/v6.87.0...v6.88.0)

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "FormSG",
"description": "Form Manager for Government",
"version": "6.89.0",
"version": "6.89.1",
"homepage": "https://form.gov.sg",
"authors": [
"FormSG <[email protected]>"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -430,32 +430,6 @@ export const validateStorageSubmission = async (
req.formsg.filteredResponses = responses
return { parsedResponses, form: formDef }
})
.mapErr((error) => {
// TODO(FRM-1318): Set DB flag to true to harden submission validation after validation has similar error rates as email mode forms.
if (
req.formsg.featureFlags.includes(
featureFlags.encryptionBoundaryShiftHardValidation,
)
) {
logger.error({
message: 'Error processing responses',
meta: logMeta,
error,
})
const { statusCode, errorMessage } = mapRouteError(error)
return res.status(statusCode).json({
message: errorMessage,
})
}
logger.warn({
message:
'Error processing responses, but proceeding with submission as submission have been validated client-side',
meta: logMeta,
error,
})
req.formsg.filteredResponses = req.body.responses
return error
})
.andThen(({ parsedResponses, form }) => {
// Validate MyInfo responses
const { authType } = form
Expand Down Expand Up @@ -511,8 +485,9 @@ export const validateStorageSubmission = async (
meta: logMeta,
error,
})
return res.status(StatusCodes.INTERNAL_SERVER_ERROR).json({
message: 'Error saving responses in req.body',
const { statusCode, errorMessage } = mapRouteError(error)
return res.status(statusCode).json({
message: errorMessage,
spcpSubmissionFailure,
})
})
Expand Down

0 comments on commit 9767656

Please sign in to comment.