Skip to content

docs: surface the events-ringbuf-size-0 default in the README#37

Open
snabb wants to merge 1 commit into
sysgrok:nextfrom
snabb:docs/events-ringbuf-size
Open

docs: surface the events-ringbuf-size-0 default in the README#37
snabb wants to merge 1 commit into
sysgrok:nextfrom
snabb:docs/events-ringbuf-size

Conversation

@snabb
Copy link
Copy Markdown

@snabb snabb commented May 19, 2026

Hi again :)

Same gotcha I just pinged you about on esp-idf-matter (sysgrok/esp-idf-matter#28), but documented on the side that actually owns the features.

Burned a few hours debugging a Matter Generic Switch where emit_event returned Ok and max_seen_event_number advanced on every button press, yet the controller never received an event. Walking back through rs-matter's EventWriter::write:

if N == 0 { return Ok(()); }

…lined up with the events-ringbuf-size-0 default. The `Cargo.toml` inline comment is accurate but invisible to anyone reading the README, and the failure mode is "everything looks fine, controller just sees nothing" — not the easiest to track down.

Adds a short README section with the bit, the fix, and a sizing note. Wording is just a sketch.

An alternative (if it makes sense) would be to change the default to a non-zero size like 256 or 512, so devices that emit any event — today that's any cluster handler calling `emit_for`, plus rs-matter's own `AccessControlEntryChanged` event on ACL writes during commissioning — work out of the box, and only users explicitly disabling events would opt into 0.

The events-ringbuf-size-{0..2048} features select the per-priority event
buffer size in `Events<N>`. The default of 0 silently no-ops every event
write in rs-matter's `EventWriter::write` (`dm/events.rs`):

    if N == 0 { return Ok(()); }

`emit_event()` returns Ok, the subscription's `max_seen_event_number`
advances, but no bytes are ever stored and the controller never sees
event reports. The failure mode is subtle and easy to spend hours
chasing.

This affects any device that emits events, which is most of them:
Generic Switch (0x000F) is unusable without Switch cluster events, and
BasicInformation::StartUp on boot is required by Matter Core 1.5.1
§11.1.6. The Cargo.toml inline comment ("events will not be emitted")
understates the failure mode and isn't visible to anyone reading the
README.

Adds a short Event ring-buffer section with the gotcha, the fix, and
sizing guidance.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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