fix(configuration): resolve Discord guild and Slack workspace filters by id - #87
Open
iphuongtt wants to merge 1 commit into
Open
fix(configuration): resolve Discord guild and Slack workspace filters by id#87iphuongtt wants to merge 1 commit into
iphuongtt wants to merge 1 commit into
Conversation
… by id `filters.guild` and `filters.workspace` were compared against the connection slug in `resolveResource`, so a documented snowflake id never matched and activation failed with "does not match any Discord connection" even when the organization had a connection for that exact guild. The Discord branch already returned `connection.guildId` as the resolved resource id, and the Slack branch returned `connection.teamId`, so the lookup key and the resolved value disagreed. The GitHub branch above matches on the resource (`repository.fullName`) and was unaffected. Match on the resource id while continuing to accept the connection slug, which keeps existing slug-based configurations activating. Documented in public-docs as "Discord filters use IDs, not server names, display names, or Hub connection slugs". Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
filters.guildnever matches a real Discord guild id. Activation fails with a message that names the very connection that owns the guild:The organization has a connection for exactly that guild:
Cause
resolveResourcelooks the connection up by slug but returns the resource id, so the lookup key and the resolved value disagree:resourceisfilters.guild(viareadAuthoredResource), so a snowflake id is compared to a slug such as"example-discord"and can never match. The Slack branch has the same shape withteamId. The GitHub branch above matches on the resource (repository.fullName) and is unaffected.This contradicts the public docs, which state:
and instruct users to obtain the value via Copy Server ID.
Fix
Match on the resource id, while still accepting the connection slug:
I kept the slug arm deliberately.
store.test.tshas a passing test that authorsguild: "discord-primary"(a slug) and expects activation to succeed, and existing self-hosted configurations may rely on that. Dropping it would be a breaking change beyond the scope of this bug. Happy to cut it if you would rather take the hard change perAGENTS.md.Tests
Added
accepts a Discord guild id as documented in filters.guild, which asserts the authored guild id activates and compiles to the rightconnectionId/resourceId.Verified it is a real regression test: on
mainit fails atassert.equal(revision.validationErrors, null); with the fix it passes.The existing rejection test still passes unchanged — its id (
1481169421832814616) is notprimary.guildId("100"), so an unknown guild is still correctly rejected.Verification against a live instance
Same bundle, same database, only the image differs:
ghcr.io/getpaseo/hub:latest(0.8.0)Error: ... does not match any Discord connectionPROJECT default · VALID true · WORKFLOWS 1🤖 Generated with Claude Code