Skip to content

fix(ota): subscription-log check misses post-reboot Re-Subscription (#64) - #78

Merged
AndrewDemsDS merged 1 commit into
mainfrom
fix/ota-subscription-log-resubscribe
Jul 22, 2026
Merged

fix(ota): subscription-log check misses post-reboot Re-Subscription (#64)#78
AndrewDemsDS merged 1 commit into
mainfrom
fix/ota-subscription-log-resubscribe

Conversation

@AndrewDemsDS

Copy link
Copy Markdown
Owner

Summary

check_subscription_log (the #64 post-flash gate) false-alarmed on two genuinely healthy OTAs today (nodes 14 and 62, both to 1.3.18). Two compounding bugs:

  1. It grepped <Node:N> Subscription succeeded, which cannot match the post-reboot <Node:N> Re-Subscription succeeded line (the Re- breaks the <Node:N> Subscription adjacency). After an OTA the device always reboots, so the resubscribe is the real healthy signal.
  2. It used grep -m1 (oldest match) over a 15m window, in which the pre-reboot subscription success is often already too old to be in-window.

Net effect: matter-server logged <Node:62> Re-Subscription succeeded, but the gate died with "subscription is broken".

Fix

  • Match both (Re-)?Subscription succeeded.
  • Take the most recent match (tail -1) instead of the oldest (grep -m1).
  • Poll briefly (6 x 10s) so a resubscribe that lands just after the check starts is not missed.

No weakening of the gate: the Python gate (fatal re-interview + node-available poll) already asserts subscribability, and a real 0x24 / Invalid-TLV break still fails it (no succeeded line and the node never becomes available). This log line is the belt-and-suspenders confirmation, now matching reality.

Test

  • bash -n clean.
  • Pattern verified against the real matter-server log-line shapes: matches both Subscription succeeded and Re-Subscription succeeded, ignores Setting up ... subscription and Subscription failed, is node-scoped, and picks the most recent.

Assisted-by: AI

…false #64 alarm)

check_subscription_log grepped '<Node:N> Subscription succeeded', which cannot match the
post-OTA '<Node:N> Re-Subscription succeeded' line (the 'Re-' breaks the adjacency), and used
grep -m1 (oldest match) against a 15m window in which the pre-reboot subscription is often
already too old. After an OTA the device always reboots, so the resubscribe is the real healthy
signal: both genuinely-healthy flashes on 2026-07-22 (nodes 14 and 62 to 1.3.18) tripped a false
'subscription is broken' die despite matter-server logging Re-Subscription succeeded.

Match both (Re-)?Subscription succeeded, take the most recent (tail -1, not grep -m1's oldest),
and poll briefly so a resubscribe that lands just after the check starts is not missed. The
Python gate (fatal re-interview + available poll) already asserts subscribability; this log line
is the belt-and-suspenders confirmation, now matching reality.

Assisted-by: AI
@AndrewDemsDS
AndrewDemsDS force-pushed the fix/ota-subscription-log-resubscribe branch from e97af30 to 1fd6387 Compare July 22, 2026 09:15
@AndrewDemsDS
AndrewDemsDS merged commit 5ea4ee9 into main Jul 22, 2026
4 checks passed
@AndrewDemsDS
AndrewDemsDS deleted the fix/ota-subscription-log-resubscribe branch July 22, 2026 09:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant