Skip to content

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

Merged
merged 6 commits into from
Jul 31, 2025

Conversation

MaxAake
Copy link
Contributor

@MaxAake MaxAake commented Jul 15, 2025

deprecates the old isRetriableError and introduces isRetryableError in it's place. also changes internal names with "retriable" to "retryable"

@MaxAake MaxAake changed the title Make neo4j-driver export isRetriableError Deprecate isRetriableError and ensure isRetryableError functions Jul 28, 2025
* @param {object|undefined|null} error the error object
* @returns {boolean} true if the error is retryable
*/
static isRetryable (error?: any | null): boolean {
Copy link
Member

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.

Copy link
Contributor Author

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.

Copy link
Member

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.

@MaxAake MaxAake requested a review from robsdedude July 30, 2025 14:28
Copy link
Member

@robsdedude robsdedude left a comment

Choose a reason for hiding this comment

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

🎓
🧑‍🏫

@MaxAake MaxAake merged commit e72e19f into 6.x Jul 31, 2025
37 checks passed
@MaxAake MaxAake deleted the make-isRetryableError-work-and-documented branch July 31, 2025 07:06
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