Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

lassombra
Copy link
Contributor

Implements #6108.

Test is included, as is updated documentation.
All tests in ddp-client package (including new test for #6108) pass.

Implemented as simply a noRetry flag on apply which triggers it to fail with a Meteor.Error(409) instead of retrying on reconnect.

… if it tries to send again (through the callback, which enables the possibility of fiber throwing exceptions)
Failed to do the proper reconnection in the test, so the stream only simulated one direction of reconnection.
This version simulates the stream in both directions of the reconnection.
… of reset, only if they've sent at least once, and this happens before messageSent flag is cleared. This results in it getting it's callback as soon as quiescence triggers, and the callback is called with an Error 409.
// _outstandingMethodFinished.
currentMethodBlock.splice(i, 1);
// make sure that the method is told that it failed.
methodInvoker.receiveResult(Meteor.Error(409, 'Method is non-idempotent but attempted to call a second time',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would change this to an error string - for example "invocation-failed". Error numbers in DDP are deprecated and I'd like to get rid of them if possible. Also, including the word "idempotent" in the message might be confusing for developers who don't know what that means.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I was actually going to change that just as soon as I got home after re-reading the style guide today. If 'invocation-failed' is used, the test should also be updated to expect that.

@stubailo
Copy link
Contributor

stubailo commented Feb 9, 2016

This is amazing! I especially like that I can tell that the code doesn't do anything different if the noRetry option isn't passed.

Going to merge this now, and fix the docs later.

@stubailo stubailo self-assigned this Feb 9, 2016
stubailo pushed a commit that referenced this pull request Feb 9, 2016
Closes #6108
Pull request #6180

Test is included, as is updated documentation.
All tests in ddp-client package (including new test for #6108) pass.

Implemented as simply a noRetry flag on apply which triggers it to fail with a
Meteor.Error('invocation-failed') instead of retrying on reconnect.

Test passes, methods which are marked as noRetry get an error in case of reset,
only if they've sent at least once, and this happens before messageSent flag is
cleared.  This results in it getting it's callback as soon as quiescence
triggers, and the callback is called with an Error 'invocation-failed'.

[stubailo: changed error code, fixed docs, squashed commits]
@stubailo
Copy link
Contributor

stubailo commented Feb 9, 2016

Amazing contribution! Merged as one commit: c80c741

I made some changes, hopefully that is OK with you!

@stubailo stubailo closed this Feb 9, 2016
@lassombra
Copy link
Contributor Author

Totally ok with the changes. I made note of one where the test no longer reflects the new contract. I could provide another pull request, but I suspect it'd be easier for you to just modify the one line...

@stubailo
Copy link
Contributor

Yep, doing that now!

@stubailo
Copy link
Contributor

Done: 165ea96

Thanks for noticing.

filipenevola pushed a commit that referenced this pull request Oct 19, 2021
Closes #6108
Pull request #6180

Test is included, as is updated documentation.
All tests in ddp-client package (including new test for #6108) pass.

Implemented as simply a noRetry flag on apply which triggers it to fail with a
Meteor.Error('invocation-failed') instead of retrying on reconnect.

Test passes, methods which are marked as noRetry get an error in case of reset,
only if they've sent at least once, and this happens before messageSent flag is
cleared.  This results in it getting it's callback as soon as quiescence
triggers, and the callback is called with an Error 'invocation-failed'.

[stubailo: changed error code, fixed docs, squashed commits]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants