Skip to content

Limit the lenght of User Name#2764

Merged
HunsupJung merged 5 commits intomainfrom
fix/limit-length-user-name
Mar 11, 2026
Merged

Limit the lenght of User Name#2764
HunsupJung merged 5 commits intomainfrom
fix/limit-length-user-name

Conversation

@HunsupJung
Copy link
Collaborator

@HunsupJung HunsupJung commented Feb 6, 2026

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

Summary of Completed Tests

Signed-off-by: Hunsup Jung <hunsup.jung@samsung.com>
@github-actions
Copy link

github-actions bot commented Feb 6, 2026

Channel deleted.

@github-actions
Copy link

github-actions bot commented Feb 6, 2026

Test Results

   72 files    492 suites   0s ⏱️
2 689 tests 2 689 ✅ 0 💤 0 ❌
4 550 runs  4 550 ✅ 0 💤 0 ❌

Results for commit bf23f18.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented Feb 6, 2026

File Coverage
All files 72%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-lock/src/new-matter-lock/can_handle.lua 90%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-lock/src/new-matter-lock/init.lua 64%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-lock/src/lock_utils.lua 98%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-lock/src/lazy_load_subdriver.lua 57%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-lock/src/init.lua 92%

Minimum allowed coverage is 90%

Generated by 🐒 cobertura-action against bf23f18

Comment on lines +1277 to +1280
local userNameMatter = userName
if #userNameMatter > NAME_MAX_L then
userNameMatter = string.sub(userNameMatter, 1, NAME_MAX_L)
end
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
local userNameMatter = userName
if #userNameMatter > NAME_MAX_L then
userNameMatter = string.sub(userNameMatter, 1, NAME_MAX_L)
end
local userName = string.sub(command.args.userName, 1, NAME_MAX_L)

the sub will only limit the userName input if it is too long, so no need for the extra check, or the extra variable

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

userNameMatter needs to be created for Matter. userName is used for lockUsers capability and the limitation of length is different.

HunsupJung and others added 2 commits March 7, 2026 15:17
@HunsupJung HunsupJung requested a review from hcarter-775 March 7, 2026 06:39
@hcarter-775
Copy link
Contributor

Approving but unit tests must be fixed before merging

HunsupJung and others added 2 commits March 11, 2026 20:52
Signed-off-by: Hunsup Jung <hunsup.jung@samsung.com>
@HunsupJung HunsupJung merged commit 2ba57d2 into main Mar 11, 2026
27 of 31 checks passed
@HunsupJung HunsupJung deleted the fix/limit-length-user-name branch March 11, 2026 12:32
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.

4 participants