fix: Stale data read in validation query on Parse.Object update causes inconsistency between validation read and subsequent update write operation (#9859)

This commit is contained in:
mavriel@gmail.com
2025-10-25 03:58:44 +09:00
committed by GitHub
parent 8006a9e2c1
commit f49efaf5bb
2 changed files with 71 additions and 1 deletions

View File

@@ -593,7 +593,7 @@ class DatabaseController {
convertUsernameToLowercase(update, className, this.options);
transformAuthData(className, update, schema);
if (validateOnly) {
return this.adapter.find(className, schema, query, {}).then(result => {
return this.adapter.find(className, schema, query, { readPreference: 'primary' }).then(result => {
if (!result || !result.length) {
throw new Parse.Error(Parse.Error.OBJECT_NOT_FOUND, 'Object not found.');
}