Skip to content

Wait for Max PIN length before generating credentials #2260

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

nickolas-deboom
Copy link
Contributor

@nickolas-deboom nickolas-deboom commented Jul 15, 2025

Type of Change

  • WWST Certification Request
    • If this is your first time contributing code:
      • I have reviewed the README.md file
      • I have reviewed the CODE_OF_CONDUCT.md file
      • I have signed the CLA
    • I plan on entering a WWST Certification Request or have entered a request through the WWST Certification console at developer.smartthings.com
  • Bug fix
  • New feature
  • Refactor

Checklist

  • I have performed a self-review of my code
  • I have commented my code in hard-to-understand areas
  • I have verified my changes by testing with a device or have communicated a plan for testing
  • I am adding new behavior, such as adding a sub-driver, and have added and run new unit tests to cover the new behavior

Description of Change

This change fixes a bug where if the handler for RequirePINforRemoteOperation runs before the maxCodeLength attribute of the lockCodes capability is set, a default pin length of 4 would be used, which may be shorter than the minimum pin length of the device specified by the MinPINCodeLength attribute. Therefore, the read was removed from init and added, and was moved to the handler for MaxPINCodeLength to guarantee that the max pin length is known before attempting to generate the COTA credential.

Summary of Completed Tests

Updated UTs and tested on device.

Copy link

Copy link

github-actions bot commented Jul 15, 2025

Test Results

   68 files  ±0    448 suites  ±0   0s ⏱️ ±0s
2 342 tests ±0  2 342 ✅ ±0  0 💤 ±0  0 ❌ ±0 
3 975 runs  ±0  3 975 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit f317c94. ± Comparison against base commit d69565d.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Jul 15, 2025

File Coverage
All files 84%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-lock/src/lock_utils.lua 94%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-lock/src/init.lua 91%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-lock/src/new-matter-lock/init.lua 81%

Minimum allowed coverage is 90%

Generated by 🐒 cobertura-action against f317c94

This change fixes a bug where if the handler for `RequirePINforRemoteOperation`
runs before the `maxCodeLength` attribute of the `lockCodes` capability is set,
a default pin length of 4 would be used, which may be shorter than the minimum
pin length of the device specified by the `MinPINCodeLength` attribute.
Therefore, the read was removed from `init` and `added`, and was moved to the
handler for `MaxPINCodeLength` to guarantee that the max pin length is known
before attempting to generate the COTA credential.
@nickolas-deboom nickolas-deboom force-pushed the wait-for-max-pin-length-before-generating-cota-cred branch from e68fcb3 to f317c94 Compare July 15, 2025 15:54
@tpmanley tpmanley requested a review from HunsupJung July 15, 2025 19:46
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