Commit 5270e09
fix(controller): read config status from DB in reconciliation
The _reconcile_modified_status method was reading config.status from
the cached device object (get_device uses cache_memoize with a 30-day
TTL). When the config status changed to "modified" after the device
was cached, the reconciliation would see the stale cached status and
skip the reconciliation.
Fix: query Config directly from the database using Config.objects.get()
instead of accessing device.config, which may return cached state.
Also add a test that verifies reconciliation works even when the
device object is served from cache.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 59e6512 commit 5270e09
File tree
2 files changed
+40
-1
lines changed- openwisp_controller/config
- controller
- tests
2 files changed
+40
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
187 | 187 | | |
188 | 188 | | |
189 | 189 | | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
190 | 194 | | |
191 | 195 | | |
192 | 196 | | |
193 | | - | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
194 | 205 | | |
195 | 206 | | |
196 | 207 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
326 | 326 | | |
327 | 327 | | |
328 | 328 | | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
329 | 357 | | |
330 | 358 | | |
331 | 359 | | |
| |||
0 commit comments