Repository navigation
chore(deps): remove nest-typed-config/class-validator resolution - #21533
Open
fxa-agent[bot] wants to merge 1 commit into
Open
fxa-agent[bot] wants to merge 1 commit into
fxa-agent[bot] wants to merge 1 commit into
Conversation
fxa-agent
Bot
force-pushed
the
fxa-11987
branch
from
October 15, 2026 21:45
29dc2f2 to
f4d859d
Compare
Contributor
Author
|
Updated evidence from the latest automated round. signin-signIn-severity-2-s-e7b7a-n-login-as-an-existing-user-local.webm |
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Two moderate compatibility and null-output validation issues remain unresolved.
1 open issue
What changed in this PR
Updates class-validator to 0.15.1 and adjusts payments/settings validation to prevent unknown-value failures.
Changes:
- Removes the nested validator resolution and updates dependency locks.
- Adds validation decorators and adjusts base-model validation.
- Adds regression tests for payments action results.
Two moderate issues remain: undefined getExperiments results are still rejected (4 votes), and class-validator 0.15.1 is outside the installed mapped-types peer range (1 vote).
| File | Summary |
|---|---|
yarn.lock |
Records updated validator dependency versions. |
packages/fxa-settings/src/lib/model-data/model-data-provider.ts |
Adjusts validation for undecorated base models. |
package.json |
Updates class-validator and removes the resolution. |
libs/payments/ui/src/lib/nestapp/validators/GetExperimentsActionResult.ts |
Adds experiments result validation. |
libs/payments/ui/src/lib/nestapp/validators/GetCMSChurnInterventionActionResult.ts |
Adds churn intervention array validation. |
libs/payments/ui/src/lib/nestapp/NextIOValidator.spec.ts |
Adds validator behavior tests. |
Review effort: Lite
Comment on lines
+18
to
20
| @IsOptional() | ||
| @IsObject() | ||
| experiments?: Experiments; |
Contributor
Author
There was a problem hiding this comment.
Not changed: class-validator 0.14.1 on main also rejects validateOrReject(undefined), so this is not new with the upgrade; tracked as a follow-up.
Because: * A resolution pinned class-validator to 0.14.1. * From 0.14.2, validate() without options rejects undecorated classes. This commit: * Removes the resolution and moves root class-validator to ^0.15.1. * Adds top-level decorators to two payments result classes. * Skips the unknownValue check in ModelDataProvider.validate(). Closes FXA-11987
This branch has not been 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.

Because
nest-typed-config/class-validatorresolution pinnedclass-validatorto 0.14.1 for typed config.class-validatorwas pinned to 0.14.1, so FxA did not get the 0.15.x releases.validate()rejects an unknown object by default when it gets no options. This breaks two payments-next action results.This pull request
nest-typed-config/class-validatorresolution frompackage.json.class-validatorfrom 0.14.1 to^0.15.1.yarn.lockresolves it to 0.15.1.@IsArray()tochurnInterventionsinGetCMSChurnInterventionActionResult.ts.@IsOptional()and@IsObject()toexperimentsinGetExperimentsActionResult.ts.NextIOValidator.spec.tswith 5 tests for these two classes.Issue that this pull request solves
Closes: FXA-11987
Checklist
Put an
xin the boxes that applyHow to review (Optional)
yarn.lockentries forclass-validator.package.json,yarn.lock, the two validator classes, the spec.class-validator, and the top-level only validation.Screenshots (Optional)
Not applicable. No user interface change.
Other information (Optional)
Why the validator classes changed
NextIOValidatorcallsnew Validator().validateOrReject(output)with no options.forbidUnknownValuesistrueby default in that case.GetExperimentsActionResultandGetCMSChurnInterventionActionResulthad no decorated properties.getExperimentsandgetCMSChurnInterventionaction then failed with "unknownValue: an unknown value was passed to the validate function".libs/payments/uifound only these two.@ValidateNested. Before this change, nothing in these results was validated. The CMS and Nimbus data has extra fields that nested rules could reject. Nested validation can be a follow-up.Two copies of
class-validatornest-typed-config2.10.1 requires^0.14.0. It keeps its own 0.14.4 copy. The root uses 0.15.1. I did not force one version, because the ticket forbids a new resolution.nest-typed-configaccepted valid config and rejected invalid config, declared with the root 0.15.1 decorators.@nestjs/mapped-typesdeclares the peerclass-validator^0.13 || ^0.14, so yarn prints a peer warning. A follow-up can upgrade@nestjs/mapped-types. It is out of scope here.IsIBANoptions argument. FxA does not useIsIBAN.What I ran, all passed
getExperimentsAction.spec.ts, and relatedlibs/payments/uispecs.nest-typed-configtyped config check: valid config accepted, invalid config rejected.yarn why class-validator: 0.15.1 at the root, 0.14.4 undernest-typed-config.nx build payments-next: it compiles and passes its TypeScript stage.tscinlibs/payments/ui: no errors except TS2688 for thenexttype library. Main has the same error in this VM.tsc --noEmitinfxa-settings: no errors.What I could not check
nx build payments-nextfails at the prerender of/_global-errorwith "TypeError: Cannot read properties of null (reading 'useContext')". It fails the same way on main with 0.14.1 in this VM. CI covers the full build.payments-nextdev started and its typed config loaded with noclass-validatorerror. Nest then stopped at the MySQL connection, because payments is not supported on the VM.