Repository navigation
fix(settings): stop Save All when the business phone is invalid - #1504
Conversation
saveBusinessInfo returned without throwing on an invalid phone, so Save All still wrote the other sections and reported Settings saved. Validate the phone before any write so Save All saves nothing and shows only the phone error.
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
PR Summary by QodoPrevent partial Save All when the business phone is invalid
AI Description
Diagram
High-Level Assessment
Files changed (2)
|
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewTip of the day💡 Did you know, you can hide the parts of a finding you never read, like the evidence or the agent prompt |
Related work
Issue / Discussion: None (audit finding F-14)
Summary
saveBusinessInforeturnedundefinedon an invalid business phone instead of throwing. In the Save All effect,Promise.alltherefore resolved: loyalty, discount, cloud, numbering, printing and bill template were written, and "Settings saved" appeared right after the "Invalid phone number format" toast.Save All now checks the phone with the same
normalizeOptionalPhonecall before any write. If it is invalid, nothing is saved, only the phone error shows, and the save bar stays dirty. The existingfinallyresets the in-flight state.Scope
The order-numbering validation in
saveOrderNumberingcannot fail from the UI (both prefix inputs strip to[A-Z0-9]with a 12-character limit), so it gets no preflight.Verification
Commands run:
npm run lint,npm run build:frontendnpx playwright test e2e/settings-request-budget.spec.ts --project=chromiumoxfmt --check,git diff --checkResults: all passed. The new test "Save All with an invalid business phone writes nothing and does not report success" fails without the fix (checked against a frontend build with the fix removed).
Compatibility & data safety
Cross-cutting surfaces
Developer documentation
Contributor checklist