From 0c57f9491fae41f671fb579374e72ed8bf1333a9 Mon Sep 17 00:00:00 2001 From: Jannis Braun <151788261+TheZwiss@users.noreply.github.com> Date: Wed, 8 Apr 2026 03:20:01 +0200 Subject: [PATCH] feat: late-bind dmChannelId on FederatedCallEntry when DM created mid-call When findOrCreateDmChannel creates or finds a local channel for a federatedId that has an active FederatedCallEntry with null dmChannelId, update the entry. Prevents stale null references for Path B calls. --- packages/server/src/routes/federation.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/server/src/routes/federation.ts b/packages/server/src/routes/federation.ts index 20f66aa1..ae7c7fda 100644 --- a/packages/server/src/routes/federation.ts +++ b/packages/server/src/routes/federation.ts @@ -1690,6 +1690,9 @@ function findOrCreateDmChannel( .run(); } } + // Late-bind: if a FederatedCallEntry exists for this federatedId with null dmChannelId, + // update it now that we have a local channel + connectionManager.lateBindFederatedCall(federatedId, existing.id); return existing.id; } @@ -1715,6 +1718,10 @@ function findOrCreateDmChannel( .run(); } + // Late-bind: if a FederatedCallEntry exists for this federatedId with null dmChannelId, + // update it now that we have a local channel + connectionManager.lateBindFederatedCall(federatedId, channelId); + return channelId; }