Commit ca6990a
committed
Fix shelly-ng type error, fromZigbee converter args, and platform TOCTOU
1. Fix shelly-ng CI blocker: resetReconnectInterval() doesn't exist on
the RpcHandler type. Merged the method into the existing cast type
and call via optional chaining. This was a pre-existing type error
on main that blocked generate:openapi.
2. Fix fromZigbee converter call signature: convert() expects
(model, msg, publish, options, meta) but was called with
(herdsmanDevice, data, {}, meta, {}). Now passes:
- model: discovered.definition (the device definition)
- msg: full message object with data, cluster, type, device, endpoint
- publish: no-op function (required callback, unused in our context)
- options: empty object
- meta: { state, logger, device, options }
3. Await converter.convert() result: fromZigbee converters may be async.
Without await, the Promise object was spread into convertedState
instead of the actual converted values, silently losing all data.
4. Add TOCTOU guard in platform processBatch: re-check isStarted()
per device in the loop to detect asynchronous adapter disconnections
between the initial check and actual command execution.
https://claude.ai/code/session_014bjB9Cn1WKASNLBeCuSbom1 parent d401ca7 commit ca6990a
3 files changed
Lines changed: 35 additions & 10 deletions
File tree
- apps/backend/src/plugins
- devices-shelly-ng/delegates
- devices-zigbee-herdsman
- platforms
- services
Lines changed: 5 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
244 | 244 | | |
245 | 245 | | |
246 | 246 | | |
247 | | - | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
248 | 251 | | |
249 | 252 | | |
250 | 253 | | |
251 | | - | |
| 254 | + | |
252 | 255 | | |
253 | 256 | | |
254 | 257 | | |
| |||
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
87 | 93 | | |
88 | 94 | | |
89 | 95 | | |
| |||
Lines changed: 24 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
215 | 215 | | |
216 | 216 | | |
217 | 217 | | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
218 | 232 | | |
219 | 233 | | |
220 | 234 | | |
| |||
224 | 238 | | |
225 | 239 | | |
226 | 240 | | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
234 | 250 | | |
235 | | - | |
| 251 | + | |
236 | 252 | | |
237 | 253 | | |
238 | 254 | | |
| |||
0 commit comments