Repository navigation
fix: keep documents with a null required attribute updatable - #1000
Merged
Merged
Conversation
A document stored before an attribute became required holds null for it, and updates validate the merged document, so every update of that document failed with "Missing required attribute". When the current document already holds null, the attribute may stay null on update. Creating a document without it, or clearing a stored value, still fails.
Contributor
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 22 minutes. View limit detailsLimit details: You’ve used the included review currently available. Review configuration: ⚙️ Run configuration
📒 Files selected for processing (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
1 of 2 tasks
ArnabChatterjee20k
approved these changes
Oct 7, 2026
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.
An attribute that becomes required after documents exist leaves those documents holding null for it. That happens when an optional attribute is made required, or when a required attribute is added to a populated collection.
updateDocument()and upserts validate the merged document, so every update of such a document failed withMissing required attribute, including updates that never touch the attribute.Structurealready receives the stored document ascurrentDocument. When it holds null for a required attribute, the required check and the null value check now let the attribute stay null. Setting a value still works. Clearing a stored value, and creating a document without the attribute, still fail. BulkupdateDocuments()is unchanged, sincePartialStructureonly checks required attributes present in the update.Verified on Appwrite (Postgres) with the patched validator: a partial update and an upsert of an old row now return 200 instead of 400. Clearing a set value and creating a row without the column still return 400.
Refs appwrite/appwrite#14175