Skip to content
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

refactor: remove non-portable sync-versions of methods #7580

Merged
merged 7 commits into from
Jan 29, 2025

Conversation

AlCalzone
Copy link
Member

@AlCalzone AlCalzone commented Jan 29, 2025

This PR removes the deprecated synchronous versions of several methods related to:

  • CC and message parsing and serialization
  • encryption/decryption
  • firmware handling

This required moving to Node.js 20 as the minimum - Node.js 22 is LTS.


Complete list of API changes:

  • The deprecated CommandClass.parse(...): CommandClass and the async CommandClass.parseAsync(...): Promise<CommandClass> methods have been merged into a single signature async CommandClass.parse(...): Promise<CommandClass>. Synchronous parsing of CommandClasses using the parse method is no longer possible.
  • The deprecated CommandClass.from(...): CommandClass and the async CommandClass.fromAsync(...): Promise<CommandClass> methods have been merged into a single signature CommandClass.from(...): CommandClass | Promise<CommandClass>. For CCs that support synchronous parsing, this will return a CC instance, otherwise a Promsie that resolves to one.
  • The deprecated CommandClass.serialize(...): Bytes and the async CommandClass.serializeAsync(...): Promise<Bytes> methods have been merged into a single signature async CommandClass.serialize(...): Promise<Bytes>. Synchronous serialization of CommandClasses is no longer possible.
  • The deprecated CommandClass.mergePartialCCs(...) and the async CommandClass.mergePartialCCsAsync(...) methods have been merged into a single signature async CommandClass.mergePartialCCs(...). Synchronous merging of partial CCs is no longer possible, but this should not affect applications.
  • The deprecated Message.serialize(...): Bytes and the async Message.serializeAsync(...): Promise<Bytes> methods have been merged into a single signature async Message.serialize(...): Promise<Bytes>. Synchronous serialization of Serial API messages is no longer possible.
  • SecurityManager.generateAuthKeySync and SecurityManager.generateAuthKeyAsync have been replaced with the method SecurityManager.generateAuthKey, which is now purely async
  • SecurityManager.generateEncryptionKeySync and SecurityManager.generateEncryptionKeyAsync have been replaced with the method SecurityManager.generateEncryptionKey, which is now purely async
  • The property SecurityManager.authKey was replaced with an async method async getAuthKey(): Promise<Uint8Array>
  • The property SecurityManager.encryptionKey was replaced with an async method async getEncryptionKey(): Promise<Uint8Array>
  • The following methods of the SecurityManager2 class are now async, the corresponding ...Async variants have been removed. Typically applications shouldn't need to use them:
    • setKey
    • generateNonce
    • initializeSPAN
    • initializeTempSPAN
    • nextNonce
    • getMulticastKeyAndIV
    • nextPeerMPAN
  • The extractFirmware method is now async, its ...Async counterpart was removed
  • The Controller.dsk property was removed in favor of the method async getDSK(): Promise<Uint8Array>

@AlCalzone AlCalzone merged commit e8b3387 into v15 Jan 29, 2025
22 of 23 checks passed
@AlCalzone AlCalzone deleted the remove-deprecated branch January 29, 2025 13:44
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.

1 participant