-
Notifications
You must be signed in to change notification settings - Fork 316
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
fix: On NO_ENTRY error during unbind cleanup database #1206
Conversation
1bd4aed
to
4325066
Compare
4325066
to
b2f2f03
Compare
Didnt notice this on my initial review, but the error is thrown on line 624, I think it would be easier to just not throw the error instead, ie extend the check on line 623 to ignore NO_ENTRY |
So check if |
Something like this I'd say? if (!Zdo.Buffalo.checkStatus(response)) {
if (response[0] === Zdo.Status.NO_ENTRY) {
logger.debug(`${log} no entry to remove. Removing from database.`, NS);
} else {
throw new Zdo.StatusError(response[0]);
}
} It'll execute the rest of the logic as if the bind was removed. |
b2f2f03
to
c079cf5
Compare
That was close to what I had, it just wasn't 100% clear it was response[0] that held the response code. |
* initial implementation * rework for reviewer feedback Co-authored-by: Nerivec
c079cf5
to
cfb3010
Compare
Are you using an IDE that supports Typescript (like vscode)? ZDO stuff should all be strongly typed (and automatically inferred from zigbee-herdsman/src/zspec/zdo/definition/tstypes.ts Lines 892 to 1062 in 5d02efe
|
No, I just use a very barebones vim. Never really bothered with an IDE or even syntax highlighting. |
Thanks! |
https://github.dev/Koenkk/zigbee-herdsman/blob/master/src/zspec/zdo/buffaloZdo.ts |
I'm been unable to trigger the NOT_FOUND error again today while looking at this again, I'm not sure what changed since when we talked on discord.
I've not touched the reporting code where it was triggered. I did rebase before testing and there seem to have been some other changes so something in those might have slightly changed the behavior?