Skip to content

fix(auth): correct verification alert messages for email and phone#3083

Open
v1nayG wants to merge 1 commit into
appwrite:mainfrom
v1nayG:fix/1392-auth-verification-alerts
Open

fix(auth): correct verification alert messages for email and phone#3083
v1nayG wants to merge 1 commit into
appwrite:mainfrom
v1nayG:fix/1392-auth-verification-alerts

Conversation

@v1nayG

@v1nayG v1nayG commented Jun 10, 2026

Copy link
Copy Markdown

What does this PR do?

Both updateVerificationEmail and updateVerificationPhone in updateStatus.svelte were reading the user store after invalidation to build the success notification. At that point, the store already reflected the new state, so the ternary produced the opposite message — showing 'unverified' after verifying, and vice versa.

This PR captures the intended verification state and display label before the API call so the notification always matches the action the user just performed. It also disambiguates the messages to indicate whether the email or phone was verified.

Test Plan

Verified locally by running the check, lint, and unit test suites:

  • Checked types: bun run check
  • Linted code: bun run lint
  • Ran unit tests: bun run test:unit (all 235 tests passed successfully)

Related PRs and Issues

Resolves #1392

Have you read the Contributing Guidelines on issues?

Yes

@greptile-apps

greptile-apps Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes a bug in updateStatus.svelte where verification notification messages were read from the user store after invalidate(), causing them to reflect the already-updated state and produce the opposite message (showing "unverified" after verifying, and vice versa). It also applies the same pre-capture pattern to updateStatus for consistency and adds "email"/"phone" disambiguation to the notification text.

  • updateVerificationEmail and updateVerificationPhone: newVerification and label are now captured before the SDK call, so the success notification always reflects the action the user performed rather than the post-invalidation store state.
  • updateVerificationPhone old bug: the original ternary ($user.phoneVerification ? 'unverified' : 'verified') was doubly wrong — it lacked the ! present in the email variant and also read post-invalidation.
  • updateStatus: Same pre-capture pattern applied for consistency; the old code happened to produce the correct result by coincidence, but the refactor makes the intent explicit.

Confidence Score: 5/5

Safe to merge — the change is a targeted fix to notification message logic with no side effects on the SDK calls or store invalidation flow.

The fix correctly captures state before the async SDK call and store invalidation in all three functions. The logic is straightforward, the old bug was real and well-diagnosed, and the new code produces the correct messages in all branches. No data mutations, no new async patterns, and no cross-file dependencies are affected.

No files require special attention.

Important Files Changed

Filename Overview
src/routes/(console)/project-[region]-[project]/auth/user-[user]/updateStatus.svelte Fixes inverted/post-invalidation notification messages for email/phone verification and applies the same pre-capture pattern to updateStatus for consistency

Reviews (2): Last reviewed commit: "fix(auth): correct verification alert me..." | Re-trigger Greptile

Both updateVerificationEmail and updateVerificationPhone read the user store after invalidation to build the success notification. At that point the store already reflects the new state, so the ternary produces the opposite message — showing 'unverified' after verifying and vice versa.

Capture the intended verification state and display label before the API call so the notification always matches the action the user just performed. Also disambiguate the messages to indicate whether the email or phone was verified when the user has both.
@v1nayG v1nayG force-pushed the fix/1392-auth-verification-alerts branch from 98206bf to 59e0ad3 Compare June 10, 2026 06:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🐛 Bug Report: Inconsistency in User Verification Status between Email and Phone Number

1 participant