Repository navigation
Conversation
…s unknown A migrated lock whose capacity was never read (pinUsersSupported and totalUsersSupported unset: the lock did not answer UsersNumberGet and the hub held no lockCodes maxCodes to copy at migration) fell back to an arbitrary limit of 20 in is_full. A lock already holding 20 or more codes then answered every addCredential with resourceExhausted without the command reaching the lock, and add_credential_and_user would also drop a code the lock confirmed. Seen on Yale Z-Wave locks (0129-8002-0600, 0129-8109-0DD2, 0129-8004-0600) reporting maxCodes 250 and holding 21-47 codes after migration. is_full now uses the lock's reported capacity, else the lockCodes maxCodes it reported before migration, and treats the table as not full when neither is known, so the lock itself decides. A lock that reports its capacity is still refused at that capacity.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Check all that apply
Type of Change
Checklist
Description of Change
After migration to
lockCredentials/lockUsers, some Z-Wave locks never getpinUsersSupported/totalUsersSupported: the lock does not answerUsersNumberGet, andmigrate.luaonly copieslockCodes.maxCodeswhen the hub holds it.table_utils.get_max_entriesthen falls back to an arbitrary 20, so on a lock that already holds 20 or more codes:addCredentialanswersresourceExhaustedwithout the command reaching the lock;add_credential_and_userwould also refuse to record a code the lock confirmed.We see this in the field on Yale Z-Wave locks (fingerprints
0129-8002-0600,0129-8109-0DD2,0129-8004-0600) whose cloud state showslockCodes.maxCodes: 250, holding 21–47 credentials, with both capacity attributes unset after migration. Sendingrefresh(which issuesUsersNumberGetwhen they are unset) did not fill them on the lock we tried. New guest codes cannot be added to these locks at all.This change makes
is_fulluse the lock's reported capacity, else thelockCodes.maxCodesit reported before migration, and treat the table as not full when neither is known, so the lock itself decides whether it has room. A lock that reports its capacity is still refused once it reaches it.get_max_entries(used by the code sync) is unchanged.Summary of Completed Tests
Run with
lua5.3against theapiv22_63lua_libs release, allzwave-locktest files:addCredential: sends the code to the lock past 20 entries when the lock's capacity is unknown(fails onmainwithresourceExhausted, passes with the fix: sendsUserCode:Setfor index 21 and records the confirmed credential and user).addCredential: emits resourceExhausted when the lock's reported capacity is reached(the lock reports 20 viaUsersNumberReport).add_entry: returns RESOURCE_EXHAUSTED when table is at max capacityand the two programming-code limit tests to report the capacity explicitly instead of relying on the implicit 20.main; the same 17 tests fail onmainwithout this change, none newly failing.luacheck --config .github/workflows/.luacheckrcclean on all changed files.Not yet verified on a device with this driver build; happy to test from a channel build if that helps.