Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Persisted Subscriptions do not consider new subscriptions with "keepSubscriptions=false" #36081

Closed
Apollon77 opened this issue Oct 15, 2024 · 2 comments
Assignees
Labels
bug Something isn't working darwin needs triage

Comments

@Apollon77
Copy link
Contributor

Reproduction steps

  • Imagine you have a device ( I used the current chip repo "Light" example device on macos) which was successfully operating with a controller and being connected and a subscription is established.
  • Now stop the device (device will remember this last subscription)
  • wait until the controller is not actively reconnecting to the device anymore (e.g. using latest known address) but wait for the device to be discovered
  • now start the device

Now the following happens (depending a bit on the timing):

matter.js as controller (in this case) will see the operational announcement of the device and connect and do a new subscription. According to logs this is finished in

chip log

[1728996090.398] [93151:8321308] [DMG] Registered a ReadHandler that will schedule a report between system Timestamp: 0x0000000029BBACAD and system Timestamp 0x0000000029BC9325.

matter.js log

2024-10-15 14:41:30.398 INFO InteractionClient Subscription successfully initialized with ID 1868935302 and maxInterval 60s.

Then at "2024-10-15 14:41:31.411" a new exchange is opened from device side and it starts to push all data anew from this subscription

2024-10-15 14:41:31.413 DEBUG InteractionMessenger Received DataReport chunk with 36 attributes and 0 events, suppressResponse: undefined, moreChunkedMessages: true, subscriptionId: 1868935302
...

Additionally also the subscription from before is being tried to push and errors (because we have removed this subscription n matter.js side ... if I would accept it I would have 2 subscriptions!

2024-10-15 14:41:31.446 ERROR ExchangeManager Invalid Data report with unexpected subscription ID 4118648988

... I can not find this subscription ID in chip log at all :-(

In chip log I also find:

[1728996090.429] [93151:8321308] [IM] Skip resuming live subscriptionId 1868935302

so he "saw" the new ID but skipped it ...

So it seems that when a new subscription is established with keepSubscriptions=false and somehow the "old" subscription is still there and processed (or scheduled?) that this is not deleted by the new subscription ... and also all attributes are marked as "dirtry" and also pushed again to the already seeded subscription.

Logs:

matterjs-controller.log
chip.log

Bug prevalence

always/depends on timing

GitHub hash of the SDK that was being used

master

Platform

darwin, other

Platform Version(s)

No response

Anything else?

No response

@jtung-apple
Copy link
Contributor

@Apollon77 Does this issue still track anything #37741 did not cover?

@Apollon77
Copy link
Contributor Author

I need to check that again, lets assume ok for now and I can reopen if needed

@github-project-automation github-project-automation bot moved this from Todo to Done in [Platform] Darwin Mar 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working darwin needs triage
Projects
Status: Done
Development

No branches or pull requests

2 participants