fix(beads): use hq prefix for channel bead IDs
Change ChannelBeadID to use hq-channel-* prefix instead of gt-channel-* to match the town-level beads database prefix, fixing the "prefix mismatch" error when creating channels. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
committed by
Steve Yegge
parent
2ffc8e8712
commit
7bbc09230e
@@ -127,14 +127,15 @@ func ParseChannelFields(description string) *ChannelFields {
|
||||
return fields
|
||||
}
|
||||
|
||||
// ChannelBeadID returns the bead ID for a channel name.
|
||||
// Format: gt-channel-<name>
|
||||
// ChannelBeadID returns the channel bead ID for a given channel name.
|
||||
// Format: hq-channel-<name> for town-level channels (default).
|
||||
// Town-level channels are stored in the shared beads database.
|
||||
func ChannelBeadID(name string) string {
|
||||
return "gt-channel-" + name
|
||||
return "hq-channel-" + name
|
||||
}
|
||||
|
||||
// CreateChannelBead creates a channel bead for pub/sub messaging.
|
||||
// The ID format is: gt-channel-<name> (e.g., gt-channel-alerts)
|
||||
// The ID format is: hq-channel-<name> (e.g., hq-channel-alerts) for town-level.
|
||||
// The created_by field is populated from BD_ACTOR env var for provenance tracking.
|
||||
func (b *Beads) CreateChannelBead(name string, subscribers []string, createdBy string) (*Issue, error) {
|
||||
id := ChannelBeadID(name)
|
||||
|
||||
@@ -213,9 +213,9 @@ func TestChannelBeadID(t *testing.T) {
|
||||
name string
|
||||
want string
|
||||
}{
|
||||
{"alerts", "gt-channel-alerts"},
|
||||
{"builds", "gt-channel-builds"},
|
||||
{"team-updates", "gt-channel-team-updates"},
|
||||
{"alerts", "hq-channel-alerts"},
|
||||
{"builds", "hq-channel-builds"},
|
||||
{"team-updates", "hq-channel-team-updates"},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
|
||||
Reference in New Issue
Block a user