Repository navigation
fix(auth): avoid mutating validator state in PersonalData::isValid - #11896
Akash504-ai wants to merge 3 commits into
Conversation
Greptile SummaryThis PR fixes a state-mutation bug in Confidence Score: 5/5Safe to merge — the fix is minimal, correct, and behavior-preserving with no new risk introduced. Only one file changed, the logic is functionally identical to before, and the mutation side-effect that was the root cause is cleanly eliminated. No P0/P1 findings. No files require special attention. Important Files Changed
Reviews (3): Last reviewed commit: "Merge branch '1.9.x' into fix/personalda..." | Re-trigger Greptile |
|
@Akash504-ai Hey, I just realized after my PR was merged that you had already submitted a fix. Sorry, I completely overlooked your PR. For next time, you can also tag the appropriate maintainers for review. |
What does this PR do?
This PR fixes a design issue in
PersonalData::isValid()where internal properties (userId,email,name,phone) were being mutated whenstrict=false. Mutating internal state inside a validator can introduce side effects and lead to inconsistent behavior if the same instance is reused. This change replaces mutations with local variables, ensuring the validator remains stateless and predictable while preserving existing behavior.Test Plan
$this->userId, etc.) are modified during validationRelated PRs and Issues
Fixes #11895