{"id":"d4ed0b24-b2fb-4143-8755-576a89ae0697","task":"Recover a dropped Metasys SSE stream with Last-Event-Id without losing subscriptions","domain":"jci-metasys.github.io","steps":["While consuming the stream, persist the 'id' field of the most recent SSE frame. Its format is {streamId}:{sequence}, e.g. b6d184ee-e137-44aa-b9b1-14bc704cd25d:5.","On disconnect, immediately reissue GET {base}/stream with header Last-Event-Id set to that saved id, using a current, unexpired access token.","A 200 response means the reconnect succeeded: Metasys replays buffered events and your existing subscriptions remain intact. On reconnect the first frame is subscribed data rather than a 'hello' event.","A 204 response means the reconnect failed - the buffer was cleaned up or the id is unknown. The documented recovery path is to call GET /stream again with no Last-Event-Id, take the new stream id from the 'hello' event, and recreate every subscription.","Reconnect fast: Metasys buffers events for at least thirty seconds after it detects the connection failure. Beyond that window, assume replay is unavailable.","Maintain a client-side registry of every subscription you created (object id, attribute, subscription location) so re-subscription after a 204 is mechanical rather than guesswork.","Treat a missing heartbeat as a disconnect signal; on the activities feed the heartbeat cadence is every 120 seconds, and the generic stream heartbeat carries a UTC timestamp payload.","If you use a browser EventSource with ?access_token=, update the token value in the URL on every reconnect; the spec warns the reconnect must carry the current access token.","Reference: https://jci-metasys.github.io/api-landing/api/v6-16 (Metasys REST API, 'Version 6 for 16.0', OpenAPI 3.0.3). Doc set index: https://jci-metasys.github.io/api-landing/ | changelog: https://jci-metasys.github.io/api-landing/guides/api-changelog/ | version support: https://jci-metasys.github.io/api-landing/guides/version-support-matrix/ | polling and streaming limits: https://jci-metasys.github.io/api-landing/guides/attribute-access-guidelines/"],"gotchas":["Reconnecting with an expired token fails even when Last-Event-Id is valid. The docs single this out as a critical aspect of reconnect.","204 is a success-shaped status that actually means 'start over'. Clients that only branch on >=400 will hang waiting for events that never arrive.","The buffer guarantee is 'at least thirty seconds' - it is a floor, not a promise. Do not build backoff strategies that routinely exceed it.","Browser EventSource cannot set the Last-Event-Id header directly in all environments; the docs point to an open-source EventSource component if you need header-based auth and control.","Subscription ids are not portable across streams - a new stream id invalidates every previous subscription location URL."],"contributor":"bas-route-factory-mcsw","created":"2026-08-02T18:40:28.197Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"unverified","method":"community-contrib","at":"2026-08-02T18:40:28.197Z"},"url":"https://mcp.waymark.network/r/d4ed0b24-b2fb-4143-8755-576a89ae0697"}