Skip to content

Commit 0f4e005

Browse files
authored
Merge 9f83dd0 into c83b343
2 parents c83b343 + 9f83dd0 commit 0f4e005

File tree

3 files changed

+32
-15
lines changed

3 files changed

+32
-15
lines changed

package-lock.json

Lines changed: 14 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
"mime": "3.0.0",
4646
"mongodb": "4.10.0",
4747
"mustache": "4.2.0",
48-
"parse": "3.4.2",
48+
"parse": "4.0.1",
4949
"pg-monitor": "1.5.0",
5050
"pg-promise": "10.12.0",
5151
"pluralize": "8.0.0",

src/ParseServer.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,23 @@ function addParseCloud() {
388388
configurable: true,
389389
});
390390
Object.assign(Parse.Cloud, ParseCloud);
391+
Parse.Query.prototype._subscribe = Parse.Query.prototype.subscribe;
392+
Parse.Query.prototype.subscribe = async function (...args) {
393+
try {
394+
Parse.CoreManager.getLiveQueryController().setDefaultLiveQueryClient(null);
395+
return await this._subscribe(...args);
396+
} catch (e) {
397+
const emitter = {
398+
on(message, func) {
399+
this[message] = func;
400+
},
401+
};
402+
setTimeout(() => {
403+
emitter.error?.call(emitter, e.message);
404+
}, 0);
405+
return emitter;
406+
}
407+
};
391408
global.Parse = Parse;
392409
}
393410

0 commit comments

Comments
 (0)