diff --git a/CHANGELOG.md b/CHANGELOG.md index 262c8ba84..8309beeb0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,8 +10,11 @@ All notable changes to `hap-nodejs` will be documented in this file. This projec - Mitigate event emitter "memory leak" warnings when a significant number of camera streaming events occur simultaneously (#1037) (@hjdhjd) - AdaptiveLightingController fix & improvement (#1038) (@Shaquu) - Minor fixes to recording logging and one change in logging. (#1040) (@hjdhjd) -- Fix Build Issues (#1041) (@NorthernMan54) +- Fix: Build Issues (#1041) (@NorthernMan54) - Bridged core and core cleanup (#1048) (@Shaquu) +- Fix: Ensure data is only transmitted on open and ready connections. (#1051) (@hjdhjd) +- Fix: Ensure we check names using the full UTF-8 character set. (#1052) (@hjdhjd) +- Fix: ConfiguredName (#1049) (@donavanbecker) - Correct log spacing - Updated and fixed `typedoc` config file - Updated dependencies @@ -57,12 +60,12 @@ All notable changes to `hap-nodejs` will be documented in this file. This projec ### Changed - Create `CHANGELOG.md` file -- Fix typos + add logo to `README.md` +- Fix: typos + add logo to `README.md` - Refresh `package-lock.json` (no major changes to dep versions) - general repo updates - add alpha releases - dependency updates -- fix typedoc generation +- Fix: typedoc generation - update homebridge dependencies - regenerate docs diff --git a/src/lib/util/checkName.spec.ts b/src/lib/util/checkName.spec.ts index 539762170..52b8140eb 100644 --- a/src/lib/util/checkName.spec.ts +++ b/src/lib/util/checkName.spec.ts @@ -12,43 +12,43 @@ describe("#checkName()", () => { }); test("Accessory Name ending with !", async () => { - checkName("displayName", "name", "bad name!"); + checkName("displayName", "Name", "bad name!"); expect(consoleLogSpy).toBeCalledTimes(1); // eslint-disable-next-line max-len - expect(consoleLogSpy).toHaveBeenCalledWith("HAP-NodeJS WARNING: The accessory 'displayName' is getting published with the characteristic 'name' not following HomeKit naming rules ('bad name!'). Use only alphanumeric, space, and apostrophe characters, start and end with an alphabetic or numeric character, and don't include emojis. This might prevent the accessory from being added to the Home App or leading to the accessory being unresponsive!"); + expect(consoleLogSpy).toHaveBeenCalledWith("HAP-NodeJS WARNING: The accessory 'displayName' is getting published with the characteristic 'Name' not following HomeKit naming rules ('bad name!'). Use only alphanumeric, space, and apostrophe characters, start and end with an alphabetic or numeric character, and don't include emojis. This might prevent the accessory from being added to the Home App or leading to the accessory being unresponsive!"); }); test("Accessory Name begining with !", async () => { - checkName("displayName", "name", "!bad name"); + checkName("displayName", "Name", "!bad name"); expect(consoleLogSpy).toBeCalledTimes(1); // eslint-disable-next-line max-len - expect(consoleLogSpy).toHaveBeenCalledWith("HAP-NodeJS WARNING: The accessory 'displayName' is getting published with the characteristic 'name' not following HomeKit naming rules ('!bad name'). Use only alphanumeric, space, and apostrophe characters, start and end with an alphabetic or numeric character, and don't include emojis. This might prevent the accessory from being added to the Home App or leading to the accessory being unresponsive!"); + expect(consoleLogSpy).toHaveBeenCalledWith("HAP-NodeJS WARNING: The accessory 'displayName' is getting published with the characteristic 'Name' not following HomeKit naming rules ('!bad name'). Use only alphanumeric, space, and apostrophe characters, start and end with an alphabetic or numeric character, and don't include emojis. This might prevent the accessory from being added to the Home App or leading to the accessory being unresponsive!"); }); test("Accessory Name containing !", async () => { - checkName("displayName", "name", "bad ! name"); + checkName("displayName", "Name", "bad ! name"); expect(consoleLogSpy).toBeCalledTimes(1); // eslint-disable-next-line max-len - expect(consoleLogSpy).toHaveBeenCalledWith("HAP-NodeJS WARNING: The accessory 'displayName' is getting published with the characteristic 'name' not following HomeKit naming rules ('bad ! name'). Use only alphanumeric, space, and apostrophe characters, start and end with an alphabetic or numeric character, and don't include emojis. This might prevent the accessory from being added to the Home App or leading to the accessory being unresponsive!"); + expect(consoleLogSpy).toHaveBeenCalledWith("HAP-NodeJS WARNING: The accessory 'displayName' is getting published with the characteristic 'Name' not following HomeKit naming rules ('bad ! name'). Use only alphanumeric, space, and apostrophe characters, start and end with an alphabetic or numeric character, and don't include emojis. This might prevent the accessory from being added to the Home App or leading to the accessory being unresponsive!"); }); test("Accessory Name begining with '", async () => { - checkName("displayName", "name", "'bad name"); + checkName("displayName", "Name", "'bad name"); expect(consoleLogSpy).toBeCalledTimes(1); // eslint-disable-next-line max-len - expect(consoleLogSpy).toHaveBeenCalledWith("HAP-NodeJS WARNING: The accessory 'displayName' is getting published with the characteristic 'name' not following HomeKit naming rules (''bad name'). Use only alphanumeric, space, and apostrophe characters, start and end with an alphabetic or numeric character, and don't include emojis. This might prevent the accessory from being added to the Home App or leading to the accessory being unresponsive!"); + expect(consoleLogSpy).toHaveBeenCalledWith("HAP-NodeJS WARNING: The accessory 'displayName' is getting published with the characteristic 'Name' not following HomeKit naming rules (''bad name'). Use only alphanumeric, space, and apostrophe characters, start and end with an alphabetic or numeric character, and don't include emojis. This might prevent the accessory from being added to the Home App or leading to the accessory being unresponsive!"); }); - test("Accessory Name containing '", async () => { - checkName("displayName", "name", "bad ' name"); + test("Accessory Name ends with !", async () => { + checkName("displayName", "Name", "bad name!"); - expect(consoleLogSpy).toBeCalledTimes(0); + expect(consoleLogSpy).toBeCalledTimes(1); // eslint-disable-next-line max-len - // expect(consoleLogSpy).toHaveBeenCalledWith("HAP-NodeJS WARNING: The accessory 'displayName' is getting published with the characteristic 'name' not following HomeKit naming rules ('bad name!'). Use only alphanumeric, space, and apostrophe characters, start and end with an alphabetic or numeric character, and don't include emojis. This might prevent the accessory from being added to the Home App or leading to the accessory being unresponsive!"); + expect(consoleLogSpy).toHaveBeenCalledWith("HAP-NodeJS WARNING: The accessory 'displayName' is getting published with the characteristic 'Name' not following HomeKit naming rules ('bad name!'). Use only alphanumeric, space, and apostrophe characters, start and end with an alphabetic or numeric character, and don't include emojis. This might prevent the accessory from being added to the Home App or leading to the accessory being unresponsive!"); }); }); \ No newline at end of file