Repository navigation
fix: add emailCanonical fields to User model response - #7
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes appwrite#11906
Problem
After upgrading to Appwrite 1.9.0, if migration fails to complete properly, users get errors like:
This happens because
emailCanonicaland related fields are set in the database but were missing from the User API response model.Solution
Added
emailCanonical,emailIsCanonical,emailIsCorporate,emailIsDisposable, andemailIsFreefields to the User model response class.Changes
src/Appwrite/Utopia/Response/Model/User.php- Added 5 new fields to the User modelTesting
Additional Context
The fields are already defined in
app/config/collections/common.phpand 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.
emailCanonical,emailIsCanonical,emailIsCorporate,emailIsDisposable,emailIsFreeto theUserresponse model (nullable, not required).app/config/collections/common.php.Written for commit e841128. Summary will update on new commits.