Commit bf3b988
fix: prevent double decrement of device counters when updating removed devices
Previously, when updating the status of a removed device, the counter
for the original status would be decremented twice: once in DeleteDevice
and again in UpdateDeviceStatus. This resulted in incorrect namespace device
counters.
- Store original device status before DeviceRemovedInsert modifies it
- Track if device was removed to avoid double counter decrement
- Only decrement original status counter if device wasn't previously
removed
- Update test expectations to reflect corrected counter logic1 parent cf15fd9 commit bf3b988
2 files changed
+20
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
133 | 138 | | |
134 | 139 | | |
135 | 140 | | |
| |||
143 | 148 | | |
144 | 149 | | |
145 | 150 | | |
146 | | - | |
| 151 | + | |
147 | 152 | | |
148 | 153 | | |
149 | 154 | | |
| |||
321 | 326 | | |
322 | 327 | | |
323 | 328 | | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
324 | 335 | | |
325 | 336 | | |
326 | 337 | | |
| |||
335 | 346 | | |
336 | 347 | | |
337 | 348 | | |
| 349 | + | |
338 | 350 | | |
339 | 351 | | |
340 | 352 | | |
| |||
368 | 380 | | |
369 | 381 | | |
370 | 382 | | |
371 | | - | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
372 | 390 | | |
373 | 391 | | |
374 | 392 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4111 | 4111 | | |
4112 | 4112 | | |
4113 | 4113 | | |
4114 | | - | |
4115 | | - | |
4116 | | - | |
4117 | | - | |
4118 | 4114 | | |
4119 | 4115 | | |
4120 | 4116 | | |
| |||
0 commit comments