Skip to content

Delete guest user when SetYearDaySchedule is failed#2876

Open
HunsupJung wants to merge 1 commit intomainfrom
fix/delete-guest-user
Open

Delete guest user when SetYearDaySchedule is failed#2876
HunsupJung wants to merge 1 commit intomainfrom
fix/delete-guest-user

Conversation

@HunsupJung
Copy link
Copy Markdown
Collaborator

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

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 6, 2026

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 6, 2026

Test Results

   72 files    494 suites   0s ⏱️
2 708 tests 2 708 ✅ 0 💤 0 ❌
4 576 runs  4 576 ✅ 0 💤 0 ❌

Results for commit 9b916c7.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 6, 2026

File Coverage
All files 81%
/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 79%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-lock/src/init.lua 92%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-lock/src/lock_utils.lua 68%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-lock/src/lazy_load_subdriver.lua 57%

Minimum allowed coverage is 90%

Generated by 🐒 cobertura-action against 9b916c7

Signed-off-by: Hunsup Jung <hunsup.jung@samsung.com>
Comment on lines 1566 to 1568
else
device.log.warn(string.format("Failed to clear user: %s", status))
end
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

In the case this fails, what is the expected result?

Given the current logic, a failure would mean that

  1. lockCredentials commandResult is never emitted (HIGH importance)
  2. lockUsers commandResult for defaultSchedules will be emitted below, which will fail (MEDIUM importance)

Should we retry the ClearUser command again? If so, how many times?

Also, if it fails after some number of retries, I think we should emit a success result for lockCredentials. What do you think?

Copy link
Copy Markdown
Contributor

@ctowns ctowns left a comment

Choose a reason for hiding this comment

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

@HunsupJung could you also fill out the Summary of Completed Tests section on the top PR comment?

delete_aliro_from_table_as_user(device, userIdx)
delete_week_schedule_from_table_as_user(device, userIdx)
delete_year_schedule_from_table_as_user(device, userIdx)
if cmdName == "defaultSchedule" then
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think this handling that is specific to the defaultSchedule command could benefit from a short comment that explains why this is needed to improve readability.

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.

3 participants