-
Notifications
You must be signed in to change notification settings - Fork 161
Description
Description
Breaking Change Without Deprecation: signTransaction
Return Type Changed
Summary
The recent update to @hashgraph/sdk
changed the return type of the signTransaction
method from Uint8Array
to SignatureMap
without following proper deprecation protocols. This breaking change has significant negative impacts on applications using this method and requires substantial refactoring efforts.
Issue Description
In a recent version of @hashgraph/sdk
, the following method signature was changed:
Before:
signTransaction(transaction: Transaction): Uint8Array;
After:
signTransaction(transaction: Transaction): SignatureMap;
This change was implemented on the same method name without any deprecation notice, migration path, or backward compatibility support. Modern software development practices recommend maintaining backward compatibility through proper deprecation cycles, especially for public-facing APIs.
Impact
This change has caused significant problems for our development team:
- Unexpected runtime errors occurred immediately after upgrading the SDK
- Our codebase required extensive refactoring to accommodate the new return type
- Development time was diverted from feature work to fixing integration issues
- Testing efforts had to be redirected to ensure the refactored code works correctly
- This compromised our release schedule and increased development costs
Suggested Solution
To maintain backward compatibility while introducing new functionality:
-
Follow Proper Deprecation Protocol:
- Mark the current method as deprecated with
@deprecated
annotations - Document the deprecation in release notes and README
- Keep the original method functioning alongside the new one for at least one major version cycle
- Mark the current method as deprecated with
-
Add New Method Instead of Changing Existing Method:
// Keep original method signTransaction(transaction: Transaction): Uint8Array; // Add new method with clear naming signTransactionWithSignatureMap(transaction: Transaction): SignatureMap;
-
Define a Deprecation Timeline:
- Clearly communicate when the deprecated method will be removed
- Provide migration guides for moving to the new method
- Consider implementing console warnings when deprecated methods are used
Best Practices for SDK Evolution
For future reference, we recommend following these practices:
- Semantic Versioning: Follow SemVer strictly for all releases
- Change Log: Clearly document breaking changes in CHANGELOG.md
- Migration Guides: Provide step-by-step guidance for upgrading
- Deprecation Notices: Use proper annotations and runtime warnings
- Breaking Changes: Reserve breaking changes for major version updates
Conclusion
Breaking changes without proper deprecation cycles create significant overhead for developers using the SDK. By implementing a proper deprecation strategy, SDK maintainers can provide new functionality while respecting the investment users have made in existing implementations.
We respectfully request that the team considers reverting this change or providing backward compatibility until proper deprecation can be implemented in a future major version release.
Steps to reproduce
- install v0.44.0 or older
- create an engine/script to sign any transaction using the signTransaction method.
- update to version 0.51.0 or higher
- verify the back compatibility is broken, and you'll be forced to adapt your code.
Additional context
No response
Hedera network
No response
Version
v0.59.0
Operating system
None