Skip to content

fix(matter): resume Apple Home status after restart - #4

Merged
Ruhanpaco merged 1 commit into
Ruhanpaco:mainfrom
grapefizz:agent/apple-home-restart-status
Aug 18, 2026
Merged

fix(matter): resume Apple Home status after restart#4
Ruhanpaco merged 1 commit into
Ruhanpaco:mainfrom
grapefizz:agent/apple-home-restart-status

Conversation

@grapefizz

@grapefizz grapefizz commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

What changed

  • enable the supported ESP32 Matter subscription persistence option
  • log whether persistence is compiled into the running firmware
  • verify the generated CHIP GN argument in the Matter firmware workflow

Why

Apple Home watches the lock through a Matter subscription. Without a persisted subscription, a reboot discards it and Apple Home can remain on “Updating…” or “No Response” until it rediscovers the accessory and subscribes again.

The earlier attempt used CONFIG_CHIP_PERSIST_SUBSCRIPTIONS, which is not a Kconfig symbol. ESP-IDF only warned and ignored it. The supported ESP32 symbol is CONFIG_ENABLE_PERSIST_SUBSCRIPTIONS; the CHIP component maps it to chip_persist_subscriptions = true. connectedhomeip also derives timeout-resumption retries from that argument, which matters because this firmware starts Matter before application-controlled Wi-Fi is connected.

Impact

After a restart or temporary network loss, the device can resume Apple Home’s stored Matter subscription instead of waiting for the controller to rebuild it. A device that remains physically powered off still becomes unreachable according to the controller’s normal timeout; firmware cannot report while unpowered.

Validation

  • ./tools/check_consistency.py — 0 problems, 0 notes
  • git diff --check upstream/main...HEAD
  • all GitHub workflow YAML parsed successfully
  • Matter workflow now verifies build/esp-idf/chip/args.gn contains chip_persist_subscriptions = true

A full Matter build was not run locally because ESP-IDF is unavailable; the GitHub Matter workflow contains the effective-build guard.

Summary by CodeRabbit

  • New Features

    • Enabled Matter subscription persistence across device restarts.
    • Added startup status logging to indicate whether subscription persistence is active.
  • Bug Fixes

    • Helps prevent Matter controllers from remaining in an “Updating” state after device restarts.
  • Tests

    • Builds now verify that subscription persistence is enabled.

@coderabbitai

coderabbitai Bot commented Aug 18, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 06d51ae8-e7c8-4ebd-b85d-eb178427f716

📥 Commits

Reviewing files that changed from the base of the PR and between 53d4ebb and b462b52.

📒 Files selected for processing (3)
  • .github/workflows/matter-firmware.yml
  • components/matter_lock/matter_lock.cpp
  • sdkconfig.matter

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

Matter firmware now enables persisted subscriptions and subscription-timeout resumption. The build workflow verifies the generated CHIP setting. Startup logging reports whether persistence is enabled and warns about controller state after restarts when it is disabled.

Changes

Matter subscription persistence

Layer / File(s) Summary
Enable and validate subscription persistence
.github/workflows/matter-firmware.yml, sdkconfig.matter
CONFIG_ENABLE_PERSIST_SUBSCRIPTIONS enables subscription persistence and resumption retries. The workflow fails if the generated CHIP arguments omit chip_persist_subscriptions = true.
Report persistence state at startup
components/matter_lock/matter_lock.cpp
The component includes the Matter application configuration header and logs the subscription-persistence state after startup.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to b462b

The change enables Matter subscription persistence and verifies the effective firmware setting, improving status recovery after restart; no actionable merge-blocking risk remains beyond normal checks and review.

Suggested reviewers: ruhanpaco

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: restoring Apple Home status after a Matter device restart through subscription persistence.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Ruhanpaco
Ruhanpaco marked this pull request as ready for review August 18, 2026 18:29
@Ruhanpaco
Ruhanpaco merged commit ddc70b4 into Ruhanpaco:main Aug 18, 2026
5 of 6 checks passed
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.

2 participants