fix(photon): label upstream CatchUpEvents failures - #50071
Conversation
There was a problem hiding this comment.
Pull request overview
This PR improves operational diagnostics for the Photon iMessage sidecar by distinguishing Photon Spectrum CatchUpEvents internal server errors as upstream of Hermes, helping operators avoid chasing local allowlist/pairing issues when inbound delivery stalls.
Changes:
- Add
inboundStreamErrorMessage()in the Photon sidecar to enrich inbound stream error logs whenCatchUpEventsfailures occur. - Update the inbound stream retry loop to use the new diagnostic message.
- Add a regression test to ensure the diagnostic strings remain present in the sidecar source.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| plugins/platforms/photon/sidecar/index.mjs | Adds error classification for CatchUpEvents failures and routes the retry-loop logging through it. |
| tests/plugins/platforms/photon/test_spectrum_patch.py | Adds a regression assertion to prevent the new diagnostic from disappearing. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| out += | ||
| " | Photon Spectrum CatchUpEvents returned an internal server error; " + | ||
| "this is upstream of Hermes, so inbound iMessages may not be delivered " + | ||
| "until Photon recovers or the stream is re-established."; |
| assert "function inboundStreamErrorMessage" in index | ||
| assert "EventService/CatchUpEvents" in index | ||
| assert "this is upstream of Hermes" in index | ||
| assert "PHOTON_ALLOWED_USERS" in index |
|
We saw this exact diagnostic gap on a live gateway today: the local sidecar was alive and listening, but Local state during failure: Errors included both: The added operator hint is useful because the failure is upstream of Hermes receiving an event. Without that label, it is easy to waste time checking Cherry-picked locally with the existing fatal-inbound recovery logic preserved; focused checks passed: |
Summary
CatchUpEventsinternal server errors as upstream of HermesBackground
While dogfooding Photon iMessage through Hermes, the gateway and sidecar were healthy (
/healthzreturned{"ok": true}), but inbound delivery stopped and the sidecar repeatedly logged:Restarting the gateway/sidecar re-established the stream and replies resumed. This failure happens before Hermes receives an inbound event, so chasing
PHOTON_ALLOWED_USERSor pairing state is misleading. The PR makes that distinction explicit in logs for future operators.Tests
node --check plugins/platforms/photon/sidecar/index.mjspython -m pytest tests/plugins/platforms/photon/test_spectrum_patch.py -q