While there's a couple of excellent tools to debug the DDP communication, I still tend to rely on the browser's _Network_ tab. In this case, I can't see the whole DDP messages but a short prefix instead. It's fine for all but one message: method.
For example, if I'd like to check whether a subscription is ready, the id of a subscription is the second key both in the sub and ready messages (source, source). Similarly, added/changed/removed maintain the order of msg, collection, id - the exact one we care about.
Now, let's get to methods. The result is fine (source, source), but for some reason, method is not - it sends the id last.
My proposal is to move the id sent in the method message to the second or third position:
const message = {
msg: 'method',
+ id: methodId,
method: name,
- params: args,
- id: methodId
+ params: args
};
That sounds reasonable to me. Go ahead and create a PR, I think this will be a small change and since it is an object it shouldn't affect anything function wise.
Most helpful comment
That sounds reasonable to me. Go ahead and create a PR, I think this will be a small change and since it is an object it shouldn't affect anything function wise.