mirror of
https://github.com/parse-community/parse-server
synced 2026-08-09 13:03:18 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e9ae4351a1 | ||
|
|
4f0f0ec4bb | ||
|
|
0ec923937b |
@@ -1,3 +1,10 @@
|
||||
## [5.4.3](https://github.com/parse-community/parse-server/compare/5.4.2...5.4.3) (2023-03-22)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Unable to create new role if `beforeSave` hook exists ([#8474](https://github.com/parse-community/parse-server/issues/8474)) ([4f0f0ec](https://github.com/parse-community/parse-server/commit/4f0f0ec4bb7334adf64fcbfb80589727dc46906d))
|
||||
|
||||
## [5.4.2](https://github.com/parse-community/parse-server/compare/5.4.1...5.4.2) (2023-02-16)
|
||||
|
||||
|
||||
|
||||
Generated
+9
-8
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "parse-server",
|
||||
"version": "5.4.2",
|
||||
"version": "5.4.3",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
@@ -1173,19 +1173,20 @@
|
||||
}
|
||||
},
|
||||
"@graphql-tools/merge": {
|
||||
"version": "8.3.6",
|
||||
"resolved": "https://registry.npmjs.org/@graphql-tools/merge/-/merge-8.3.6.tgz",
|
||||
"integrity": "sha512-uUBokxXi89bj08P+iCvQk3Vew4vcfL5ZM6NTylWi8PIpoq4r5nJ625bRuN8h2uubEdRiH8ntN9M4xkd/j7AybQ==",
|
||||
"version": "8.3.17",
|
||||
"resolved": "https://registry.npmjs.org/@graphql-tools/merge/-/merge-8.3.17.tgz",
|
||||
"integrity": "sha512-CLzz49lc6BavPhH9gPRm0sJeNA7kC/tF/jLUTQsyef6xj82Jw3rqIJ9PE+bk1cqPCOG01WLOfquBu445OMDO2g==",
|
||||
"requires": {
|
||||
"@graphql-tools/utils": "8.12.0",
|
||||
"@graphql-tools/utils": "9.2.0",
|
||||
"tslib": "^2.4.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@graphql-tools/utils": {
|
||||
"version": "8.12.0",
|
||||
"resolved": "https://registry.npmjs.org/@graphql-tools/utils/-/utils-8.12.0.tgz",
|
||||
"integrity": "sha512-TeO+MJWGXjUTS52qfK4R8HiPoF/R7X+qmgtOYd8DTH0l6b+5Y/tlg5aGeUJefqImRq7nvi93Ms40k/Uz4D5CWw==",
|
||||
"version": "9.2.0",
|
||||
"resolved": "https://registry.npmjs.org/@graphql-tools/utils/-/utils-9.2.0.tgz",
|
||||
"integrity": "sha512-s3lEG1iYkyYEnKCWrIFECX3XH2wmZvbg6Ir3udCvIDynq+ydaO7JQXobclpPtwSJtjlS353haF//6V7mnBQ4bg==",
|
||||
"requires": {
|
||||
"@graphql-typed-document-node/core": "^3.1.1",
|
||||
"tslib": "^2.4.0"
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "parse-server",
|
||||
"version": "5.4.2",
|
||||
"version": "5.4.3",
|
||||
"description": "An express module providing a Parse-compatible API server",
|
||||
"main": "lib/index.js",
|
||||
"repository": {
|
||||
@@ -21,7 +21,7 @@
|
||||
"dependencies": {
|
||||
"@graphql-yoga/node": "2.6.0",
|
||||
"@graphql-tools/utils": "8.12.0",
|
||||
"@graphql-tools/merge": "8.3.6",
|
||||
"@graphql-tools/merge": "8.3.17",
|
||||
"@graphql-tools/schema": "9.0.4",
|
||||
"@parse/fs-files-adapter": "1.2.2",
|
||||
"@parse/push-adapter": "4.1.2",
|
||||
|
||||
@@ -601,4 +601,12 @@ describe('Parse Role testing', () => {
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
it('should save role when beforeSave hook for _Role is present.', async done => {
|
||||
Parse.Cloud.beforeSave('_Role', () => {});
|
||||
const role = new Parse.Role('roleName', new Parse.ACL());
|
||||
await role.save({}, { useMasterKey: true });
|
||||
expect(role.id).toBeDefined();
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
+13
-8
@@ -87,7 +87,10 @@ function RestWrite(config, auth, className, query, data, originalData, clientSDK
|
||||
// Shared SchemaController to be reused to reduce the number of loadSchema() calls per request
|
||||
// Once set the schemaData should be immutable
|
||||
this.validSchemaController = null;
|
||||
this.pendingOps = {};
|
||||
this.pendingOps = {
|
||||
operations: null,
|
||||
identifier: null,
|
||||
};
|
||||
}
|
||||
|
||||
// A convenient method to perform all the steps of processing the
|
||||
@@ -219,10 +222,13 @@ RestWrite.prototype.runBeforeSaveTrigger = function () {
|
||||
}
|
||||
|
||||
const { originalObject, updatedObject } = this.buildParseObjects();
|
||||
|
||||
const identifier = updatedObject._getStateIdentifier();
|
||||
const stateController = Parse.CoreManager.getObjectStateController();
|
||||
const [pending] = stateController.getPendingOps(updatedObject._getStateIdentifier());
|
||||
this.pendingOps = { ...pending };
|
||||
const [pending] = stateController.getPendingOps(identifier);
|
||||
this.pendingOps = {
|
||||
operations: { ...pending },
|
||||
identifier,
|
||||
};
|
||||
|
||||
return Promise.resolve()
|
||||
.then(() => {
|
||||
@@ -1569,7 +1575,7 @@ RestWrite.prototype.runAfterSaveTrigger = function () {
|
||||
.then(result => {
|
||||
const jsonReturned = result && !result._toFullJSON;
|
||||
if (jsonReturned) {
|
||||
this.pendingOps = {};
|
||||
this.pendingOps.operations = {};
|
||||
this.response.response = result;
|
||||
} else {
|
||||
this.response.response = this._updateResponseWithData(
|
||||
@@ -1673,10 +1679,9 @@ RestWrite.prototype.cleanUserAuthData = function () {
|
||||
};
|
||||
|
||||
RestWrite.prototype._updateResponseWithData = function (response, data) {
|
||||
const { updatedObject } = this.buildParseObjects();
|
||||
const stateController = Parse.CoreManager.getObjectStateController();
|
||||
const [pending] = stateController.getPendingOps(updatedObject._getStateIdentifier());
|
||||
for (const key in this.pendingOps) {
|
||||
const [pending] = stateController.getPendingOps(this.pendingOps.identifier);
|
||||
for (const key in this.pendingOps.operations) {
|
||||
if (!pending[key]) {
|
||||
data[key] = this.originalData ? this.originalData[key] : { __op: 'Delete' };
|
||||
this.storage.fieldsChangedByTrigger.push(key);
|
||||
|
||||
Reference in New Issue
Block a user