Ben Barclay
f4df260f26
fix(relay): attach metadata.user_id on guild replies for egress fallback ( #68320 )
...
The relay adapter re-attaches an egress discriminator on outbound replies
so the connector can resolve the owning tenant. It captured scope_id for
scoped (guild) messages and user_id for DMs, but as MUTUALLY EXCLUSIVE:
a scoped inbound hit an early return, so the author's user_id was never
recorded, and _with_scope only attached user_id when there was no
scope_id. Guild replies therefore went out with scope_id only.
That's fine while the guild has a provision-time route row. But a MANAGED
Discord agent joins guilds dynamically (the shared bot is added to /
removed from servers at runtime), and GATEWAY_RELAY_ROUTE_KEYS — the only
thing that writes guild route rows — is a self-hosted, static field never
stamped for managed agents. So their guild has no route row, the
connector's guild-route lookup misses, and with no user_id on the frame
there's nothing to fall back to → every guild reply is declined
"discord egress declined: target not routed to an onboarded tenant"
even though INBOUND resolved the same guild fine (via the author-first
SharedSocketRouter.targets() fallback).
Fix: capture the authentic author user_id for EVERY inbound (DM and
scoped alike) and re-attach it on the outbound reply alongside scope_id.
The connector consults it only on a route/scope miss, so carrying both
never overrides routing-table resolution. This is the gateway half of the
paired gateway-gateway change (makeDiscordTenantOf guild-route-miss
author-binding fallback); together they make guild replies resolve the
same observed-author way inbound already does.
Tests (tests/gateway/relay/test_relay_adapter.py): a guild reply now
carries both scope_id AND user_id; a scoped inbound with no author still
yields scope_id only (never invents one). Verified fail-without /
pass-with.
2026-07-21 17:04:34 +10:00
..
2026-07-21 17:04:34 +10:00
2026-07-10 19:28:03 +05:30
2026-07-13 23:26:10 +05:30
2026-07-19 03:49:29 -07:00
2026-07-20 02:22:22 -07:00
2026-07-16 04:43:45 -07:00
2026-07-19 03:49:29 -07:00
2026-07-16 04:26:06 -07:00
2026-07-09 19:09:38 -07:00
2026-07-20 13:04:12 -07:00
2026-07-05 14:48:28 -07:00
2026-07-13 23:26:10 +05:30
2026-07-16 06:29:09 -07:00
2026-07-13 23:26:10 +05:30
2026-07-03 03:27:47 -07:00
2026-07-16 07:17:55 -07:00
2026-07-13 04:31:55 -07:00
2026-07-02 13:25:25 +05:30
2026-07-20 13:04:12 -07:00
2026-07-13 04:31:55 -07:00
2026-07-14 16:58:47 +05:30
2026-07-08 08:10:28 -07:00
2026-07-18 00:05:25 -07:00
2026-07-10 12:38:48 +05:30
2026-07-11 05:41:58 -07:00
2026-07-20 13:04:12 -07:00
2026-07-14 13:58:36 -07:00
2026-07-18 20:01:55 +05:30
2026-07-05 06:29:26 -07:00
2026-07-07 17:04:32 -07:00
2026-07-09 06:27:04 -07:00
2026-07-02 03:08:11 -07:00
2026-07-20 13:04:12 -07:00
2026-07-20 03:27:22 -07:00
2026-07-14 21:31:32 -07:00
2026-07-17 04:51:39 -07:00
2026-07-13 07:28:21 -07:00
2026-07-09 18:04:00 -07:00
2026-07-02 05:10:31 -07:00
2026-07-02 12:49:42 +05:30
2026-07-14 16:56:34 +05:30
2026-07-14 16:56:34 +05:30
2026-07-04 13:28:47 -07:00
2026-07-20 05:39:24 -07:00
2026-07-11 23:46:13 +05:30
2026-07-19 03:49:29 -07:00
2026-07-07 22:15:04 -07:00
2026-07-13 23:26:10 +05:30
2026-07-06 01:37:10 +05:30
2026-07-04 13:28:47 -07:00
2026-07-19 00:45:32 -07:00
2026-07-20 11:52:41 +05:30
2026-07-18 20:01:55 +05:30
2026-07-01 15:38:34 -04:00
2026-07-07 02:40:12 -07:00
2026-07-05 06:42:42 -07:00
2026-07-05 13:58:11 -07:00
2026-07-07 06:25:23 -07:00
2026-07-07 17:01:08 -07:00
2026-07-18 20:01:55 +05:30
2026-07-18 14:01:33 -07:00
2026-07-07 02:40:12 -07:00
2026-07-07 06:25:23 -07:00
2026-07-07 05:50:08 -07:00
2026-07-07 17:00:58 -07:00
2026-07-07 12:42:29 -07:00
2026-07-07 12:42:29 -07:00
2026-07-18 12:28:59 -07:00
2026-07-02 03:12:53 -07:00
2026-07-02 03:00:59 -07:00
2026-07-13 23:26:10 +05:30
2026-07-09 02:22:12 +05:30
2026-07-20 03:27:22 -07:00
2026-07-20 09:19:24 -07:00
2026-07-20 09:28:24 -07:00
2026-07-16 04:40:23 -07:00
2026-07-16 08:02:47 -07:00
2026-07-18 20:01:55 +05:30
2026-07-20 05:38:25 -07:00
2026-07-18 12:28:59 -07:00
2026-07-16 05:39:58 -07:00
2026-07-18 01:30:05 -07:00
2026-07-15 09:48:24 -07:00
2026-07-02 00:05:48 +05:30
2026-07-20 11:10:49 -07:00
2026-07-01 05:38:03 -07:00
2026-07-20 11:10:49 -07:00
2026-07-16 05:39:58 -07:00
2026-07-18 14:01:33 -07:00
2026-07-20 02:22:22 -07:00
2026-07-20 02:22:22 -07:00
2026-07-18 14:01:56 -07:00
2026-07-16 07:22:24 -07:00
2026-07-18 20:01:55 +05:30
2026-07-16 15:59:45 +05:30
2026-07-16 07:57:06 -07:00
2026-07-08 00:34:34 +00:00
2026-07-15 12:11:16 -07:00
2026-07-07 18:25:39 +10:00
2026-07-16 07:17:55 -07:00
2026-07-03 03:33:06 -07:00
2026-07-04 16:34:16 -07:00
2026-07-05 21:48:59 -07:00
2026-07-07 02:18:17 -07:00
2026-07-17 20:55:24 +00:00
2026-07-16 07:21:23 -07:00
2026-07-18 19:38:21 +05:30
2026-07-10 12:38:48 +05:30
2026-07-15 09:50:05 -07:00
2026-07-15 09:50:05 -07:00
2026-07-19 14:58:59 +05:30
2026-07-05 00:41:34 -07:00
2026-07-09 19:09:38 -07:00
2026-07-05 21:48:59 -07:00
2026-07-03 03:33:06 -07:00
2026-07-05 13:57:37 -07:00
2026-07-11 08:42:21 -07:00
2026-07-12 00:26:49 -07:00
2026-07-14 11:46:40 -07:00
2026-07-08 00:20:23 +00:00
2026-07-19 08:25:35 +05:30
2026-07-05 02:12:26 -07:00
2026-07-05 13:42:46 -07:00
2026-07-20 12:11:07 +05:30
2026-07-17 04:51:39 -07:00
2026-07-16 05:08:56 -07:00
2026-07-05 13:58:03 -07:00
2026-07-20 13:04:12 -07:00
2026-07-20 07:24:07 -07:00
2026-07-18 20:01:55 +05:30
2026-07-18 20:01:55 +05:30
2026-07-05 13:58:03 -07:00
2026-07-01 05:38:03 -07:00
2026-07-09 18:04:00 -07:00
2026-07-07 18:25:45 +10:00
2026-07-04 16:34:16 -07:00
2026-07-02 05:51:12 -07:00
2026-07-17 04:51:39 -07:00
2026-07-17 04:51:39 -07:00
2026-07-17 20:55:24 +00:00
2026-07-14 17:13:20 +05:30
2026-07-17 04:51:39 -07:00
2026-07-17 04:51:39 -07:00
2026-07-17 18:58:29 +05:30
2026-07-18 20:01:55 +05:30
2026-07-18 19:53:00 +05:30
2026-07-16 05:39:58 -07:00
2026-07-14 13:58:36 -07:00
2026-07-14 13:58:36 -07:00
2026-07-03 02:55:22 +05:30
2026-07-03 12:34:53 +05:30
2026-07-18 12:28:59 -07:00
2026-07-05 17:38:36 -07:00
2026-07-05 13:57:11 -07:00
2026-07-07 14:40:32 +05:30
2026-07-16 00:11:22 +05:30
2026-07-16 07:17:55 -07:00
2026-07-05 06:29:26 -07:00
2026-07-18 19:38:21 +05:30
2026-07-14 21:31:32 -07:00
2026-07-18 14:01:33 -07:00
2026-07-20 11:42:29 -04:00
2026-07-05 06:12:49 -07:00
2026-07-18 20:01:55 +05:30
2026-07-18 20:01:55 +05:30
2026-07-13 04:31:55 -07:00
2026-07-19 07:27:29 +05:30
2026-07-21 12:11:52 +05:30
2026-07-16 04:25:54 -07:00
2026-07-11 11:13:50 +05:30
2026-07-05 00:32:35 -07:00
2026-07-16 04:53:08 -07:00
2026-07-14 17:09:50 +05:30
2026-07-04 13:48:33 +05:30
2026-07-21 12:11:52 +05:30
2026-07-17 20:55:24 +00:00
2026-07-06 03:53:52 -07:00
2026-07-14 17:32:41 +05:30
2026-07-14 06:48:53 -07:00
2026-07-14 17:32:41 +05:30
2026-07-07 15:50:41 +05:30
2026-07-06 03:18:33 -07:00
2026-07-05 21:57:55 -07:00
2026-07-07 02:39:31 -07:00
2026-07-16 04:40:35 -07:00
2026-07-19 07:27:29 +05:30
2026-07-20 11:10:49 -07:00
2026-07-02 05:09:38 -07:00
2026-07-06 03:42:14 -07:00
2026-07-13 04:31:55 -07:00
2026-07-19 03:49:29 -07:00
2026-07-04 13:38:59 -07:00
2026-07-07 22:15:04 -07:00
2026-07-14 03:23:19 -07:00
2026-07-05 06:29:26 -07:00
2026-07-16 07:22:24 -07:00
2026-07-02 17:39:09 -07:00
2026-07-05 00:41:34 -07:00
2026-07-16 07:22:24 -07:00
2026-07-05 06:27:20 -07:00
2026-07-05 06:27:20 -07:00