Repository navigation
✨ Add retry middleware action
#761
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -262,7 +262,11 @@ SubmitRequest.prototype.retry = function(callback) { | |
| } | ||
| this._resetFixups(); | ||
| this.backend.emit('timing', 'submit.retry', Date.now() - this.start, this); | ||
| this.submit(callback); | ||
| var request = this; | ||
| this.backend.trigger(this.backend.MIDDLEWARE_ACTIONS.retry, this.agent, this, function(err) { | ||
|
dawidreedsy marked this conversation as resolved.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it's worth documenting the fact that this hook happens after resetting op state from fixups. I think that's the correct thing to do (since an op after fixups is kind of meaningless at this point), but it might feel inconsistent against the snapshot, which hasn't been reset. Or maybe it's a hint that we should unset the snapshot...? |
||
| if (err) return callback(err); | ||
| request.submit(callback); | ||
| }); | ||
| }; | ||
|
|
||
| // The fixups must be undone before the op is transformed forward again | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the thinking of not actively resetting the snapshot just that we get more information this way about the thing that's about to retry? I slightly wonder if this is a foot gun waiting to go off, but I guess so long as it's documented.