-
Notifications
You must be signed in to change notification settings - Fork 153
Deprecate isRetriableError and ensure isRetryableError functions #1305
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
Conversation
packages/bolt-connection/test/connection-provider/connection-provider-direct.test.js
Outdated
Show resolved
Hide resolved
packages/bolt-connection/test/connection-provider/connection-provider-direct.test.js
Show resolved
Hide resolved
* @param {object|undefined|null} error the error object | ||
* @returns {boolean} true if the error is retryable | ||
*/ | ||
static isRetryable (error?: any | null): boolean { |
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.
I can imagine user code that writes to error.retriable
. With this PR the driver starts to basically ignore that field all together (users now have to write to error.retryable
to achieve the same behavior). I'm not sure there's a legitimate use-case for such a thing or whether we'd want to support this at all, but it's a subtle breakage worth considering.
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.
This is true and to some extent a breaking change. However I can't see any real use-case for writing to retriable, and I'm okay with such usage needing to do a small bit of migration since it's a major version release. The alternative would be to still use the value of retriable internally, but then the user would need to use the deprecated member for their code to work, which is worse to me.
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.
Convinced ✔️
Just make sure that the changelog, migration guide, etc. clearly highlights this subtle breakage.
Co-authored-by: Robsdedude <[email protected]>
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.
🎓
🧑🏫
deprecates the old isRetriableError and introduces isRetryableError in it's place. also changes internal names with "retriable" to "retryable"