fix(photon): tolerate SDK builds without the iMessage effect surface

imessage.effect.message crashed the sidecar at import against SDK stubs/
builds lacking the effect surface (caught by the patch-failure health test).
Optional-chain with {} fallback; /send-effect rejects cleanly instead.
This commit is contained in:
Teknium 2026-07-28 21:51:54 -07:00
parent cf550c0863
commit 402286fcff

View file

@ -278,7 +278,10 @@ const app = await Spectrum({
telemetry,
});
const MESSAGE_EFFECTS = imessage.effect.message;
// Effect-name → native effect id map. Optional chaining: an SDK build
// without the iMessage effect surface (or a test stub) must not crash the
// sidecar at import — /send-effect then rejects with "unsupported effect".
const MESSAGE_EFFECTS = imessage?.effect?.message || {};
// ---------------------------------------------------------------------------
// Inbound: forward `app.messages` (gRPC stream) to the Python consumer.