mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
ensure the operation method msg is run after the client result to match 2.x behavior
This commit is contained in:
@@ -850,7 +850,17 @@ export class Connection {
|
||||
}
|
||||
|
||||
// If we added it to the first block, send it out now.
|
||||
if (self._outstandingMethodBlocks.length === 1) methodInvoker.sendMessage();
|
||||
if (self._outstandingMethodBlocks.length === 1) {
|
||||
if (callback && future) {
|
||||
// Ensure the method message after the result of the method ran in the client.
|
||||
future = new Promise((resolve) => {
|
||||
methodInvoker.sendMessage();
|
||||
resolve();
|
||||
});
|
||||
} else {
|
||||
methodInvoker.sendMessage();
|
||||
}
|
||||
}
|
||||
|
||||
// If we're using the default callback on the server,
|
||||
// block waiting for the result.
|
||||
|
||||
Reference in New Issue
Block a user