Skip to content

fix: add emailCanonical fields to User model response - #7

Merged
deepshekhardas merged 1 commit into
mainfrom
fix/11906-add-emailcanonical-to-user-model
May 10, 2026
Merged

deepshekhardas merged 1 commit into
mainfrom
fix/11906-add-emailcanonical-to-user-model

Conversation

@deepshekhardas

@deepshekhardas deepshekhardas commented May 10, 2026 •

Copy link
Copy Markdown
Owner

Fixes appwrite#11906

Problem

After upgrading to Appwrite 1.9.0, if migration fails to complete properly, users get errors like:

  • "Missing required attribute emailCanonical"
  • "Unknown attribute: emailCanonical"
  • "Invalid document structure: emailCanonical"

This happens because emailCanonical and related fields are set in the database but were missing from the User API response model.

Solution

Added emailCanonical, emailIsCanonical, emailIsCorporate, emailIsDisposable, and emailIsFree fields to the User model response class.

Changes

  • src/Appwrite/Utopia/Response/Model/User.php - Added 5 new fields to the User model

Testing

  1. Upgrade from Appwrite 1.8.x to 1.9.0 with failed/incomplete migration
  2. Create/update a user - should work without emailCanonical errors
  3. User API response should include all email-related fields

Additional Context

The fields are already defined in app/config/collections/common.php and set throughout the codebase (account.php, users.php, teams.php) but were missing from the response model, causing validation failures when the schema attributes don't exist.


Summary by cubic

Adds missing email fields to the User API response to match database attributes and prevent validation errors after upgrading to 1.9.0. Fixes errors like "Missing required attribute emailCanonical" when migrations are incomplete.

  • Bug Fixes
    • Added emailCanonical, emailIsCanonical, emailIsCorporate, emailIsDisposable, emailIsFree to the User response model (nullable, not required).
    • Aligns the response with attributes defined in app/config/collections/common.php.
    • Allows user create/update and responses to work without emailCanonical-related errors during partial migrations.

Written for commit e841128. Summary will update on new commits.

Fixes appwrite#11906 - Missing required attribute 'emailCanonical' After update to 1.9.0

This change adds the emailCanonical, emailIsCanonical, emailIsCorporate, emailIsDisposable,
and emailIsFree fields to the User model response. These fields were already being set
in the database and used throughout the codebase but were missing from the API response model.

When upgrading from older versions, if the migration fails to add these attributes to the
users collection schema, users can still be created/updated but the API response validation
fails because the model doesn't know about these fields.

This fix ensures the User model properly serializes these fields regardless of whether
they exist in the database schema.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

@deepshekhardas
deepshekhardas merged commit 688075c into main May 10, 2026
35 of 42 checks passed
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.

URGENT! Missing required attribute "emailCanonical" After update to 1.9.0

1 participant