Repository navigation
fix(web): improve phone settings and API authentication - #1033
Conversation
Confirm phone deletion and display backend validation errors below phone fields. Initialize the shared API key header when loading the current user. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3a586f29-42a9-436f-8ec3-e84b097c8a3b
|
@greptileai please review this pull request. |
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 42 |
| Duplication | 4 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
Reject phone updates above 30 messages per minute and cover the validation boundaries. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3a586f29-42a9-436f-8ec3-e84b097c8a3b
[High impact] The PR appears safe to merge; no new blocking issues were found. SummaryThe PR adds phone deletion confirmation, shows phone field errors, saves the account API key for shared requests, and lowers the phone send-rate limit to 30.
Reviews (4) · Last reviewed commit: "fix(web): match sanitized schedule valid..." · Reviewed by Greptile |
Add mt-1 to editable phone fields without existing top margins. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3a586f29-42a9-436f-8ec3-e84b097c8a3b
Increase editable phone field top margins from mt-1 to mt-3. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3a586f29-42a9-436f-8ec3-e84b097c8a3b
Support fetch and Axios errors in the existing error-message helper. Format backend field names for display while preserving field lookup keys. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3a586f29-42a9-436f-8ec3-e84b097c8a3b
|
Updated Settings to reuse the existing validation-message sanitizer, now supporting both fetch and Axios error shapes. Backend field names such as Added regression tests; all 67 frontend tests and changed-file lint checks pass. Full frontend type checking remains blocked by existing |
Clear credentials on logout and account switches, and ignore late API and token responses. Cover user loads, profile updates, key rotation, and pending Firebase tokens with race tests. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3a586f29-42a9-436f-8ec3-e84b097c8a3b
|
@greptileai please review the latest changes, including the session-isolation fix for discussion_r4405741690. |
|
@greptileai please run another full review of the latest PR changes, including the session-isolation fix in 03a70c4. |
There was a problem hiding this comment.
🟡 Changes recommended
Schedule validation errors are reformatted to “Day of week,” but scheduleWindowError() still matches “day_of_week,” causing overlapping-window and per-day window-limit failures to show neither inline feedback nor a notification.
1 open issue
What changed in this PR
This PR improves phone settings in the web client, strengthens shared API authentication, and lowers the backend phone message-rate limit.
Changes:
- Add phone deletion confirmation and field-level validation feedback that keeps failed edits open.
- Save API keys from user responses and prevent stale authentication responses from restoring cleared credentials.
- Cap
messages_per_minuteat 30 and add validation, error-formatting, and authentication tests.
| File | Description |
|---|---|
web/app/utils/errors.ts |
Support shared validation-error formatting for fetch and Axios errors. |
web/app/utils/errors.test.ts |
Test validation-error formats and non-validation failures. |
web/app/stores/auth.ts |
Save API keys and guard credential updates across session changes. |
web/app/stores/auth.test.ts |
Test API-key propagation and stale authentication responses. |
web/app/pages/settings/index.vue |
Add phone deletion confirmation and field-error bindings; reuse shared error formatting. |
api/pkg/validators/phone_handler_validator.go |
Lower the maximum phone message rate to 30. |
api/pkg/validators/phone_handler_validator_test.go |
Cover message-rate boundaries at 0, 30, 31, and 60. |
Review effort: Balanced
Replace 60-message phone fixtures with the new maximum of 30 messages per minute. Preserve the dedicated rate-limit test's 10-message configuration. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3a586f29-42a9-436f-8ec3-e84b097c8a3b
|
The API integration failures came from test fixtures still calling setupPhone/setupAdapterPhone with 60 messages per minute after the backend maximum changed to 30. Updated all 20 affected fixture calls to 30 and left the dedicated 10-message rate-limit test unchanged (7d6ee76). Phone validator tests and integration-test compilation pass locally. Docker is not running locally, so the full end-to-end rerun is being verified in CI. @greptileai please review the latest head, including the corrected integration fixtures. |
Keep weekday-specific window errors visible after applying the shared sanitizer. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3a586f29-42a9-436f-8ec3-e84b097c8a3b
|
Integration CI passed after correcting the phone-rate fixtures (run 40765718525). Also fixed the follow-up review finding about sanitized weekday window errors. @greptileai please review the latest head. |

Summary
Add a phone deletion confirmation dialog with the selected phone number, Cancel/Delete actions, and duplicate-submit protection.
Display backend validation errors beneath each Edit Phone input using the existing error-message bag; clear stale errors on retry and keep failed edits open.
Save the API key returned by
/v1/users/meso all subsequent shared API requests sendx-api-keyalongside Firebase bearer authentication.Cap backend phone messages_per_minute at 30 (previously 60), with boundary coverage for 0, 30, 31, and 60.
Validation
pnpm test).