mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
catch uncontrolled nested promises to avoid several uncaught logs
This commit is contained in:
@@ -20,10 +20,11 @@ export const loadAsyncStubHelpers = () => {
|
||||
|
||||
queue = queue.finally(() => {
|
||||
fn(resolve, reject);
|
||||
return promise.stubPromise;
|
||||
|
||||
return promise.stubPromise?.catch(() => {});
|
||||
});
|
||||
|
||||
promise.finally(() => {
|
||||
promise.catch(() => {}).finally(() => {
|
||||
queueSize -= 1;
|
||||
if (queueSize === 0) {
|
||||
Meteor.connection._maybeMigrate();
|
||||
@@ -98,9 +99,11 @@ export const loadAsyncStubHelpers = () => {
|
||||
serverPromiseResolver(applyAsyncPromise.serverPromise);
|
||||
hasStub = !!applyAsyncPromise.stubPromise;
|
||||
if (hasStub) {
|
||||
applyAsyncPromise.stubPromise.finally(() => {
|
||||
finished = true;
|
||||
});
|
||||
applyAsyncPromise.stubPromise
|
||||
.catch(() => {})
|
||||
.finally(() => {
|
||||
finished = true;
|
||||
});
|
||||
}
|
||||
applyAsyncPromise
|
||||
.then((result) => {
|
||||
|
||||
@@ -651,7 +651,7 @@ export class Connection {
|
||||
if (o.exception) {
|
||||
throw o.exception;
|
||||
}
|
||||
return o.stubReturnValue
|
||||
return o.stubReturnValue;
|
||||
});
|
||||
// this avoids attribute recursion
|
||||
promise.serverPromise = new Promise((resolve, reject) =>
|
||||
|
||||
Reference in New Issue
Block a user