mirror of
https://github.com/purrgrammer/grimoire.git
synced 2026-04-10 07:27:23 +02:00
Fix duplicate client tag in spell encoding (#215)
The client tag was being added twice to spells: 1. Unconditionally in encodeSpell() in spell-conversion.ts 2. Conditionally in publish-spell.ts based on user settings Removed the unconditional addition in encodeSpell() so the client tag is only added once by publish-spell.ts when the user setting is enabled. Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -12,7 +12,8 @@ describe("Spell Conversion", () => {
|
||||
});
|
||||
|
||||
expect(result.tags).toContainEqual(["cmd", "REQ"]);
|
||||
expect(result.tags).toContainEqual(GRIMOIRE_CLIENT_TAG);
|
||||
// Note: Client tag is NOT added by encodeSpell - it's added by publish-spell.ts
|
||||
// based on user settings to avoid duplicate tags
|
||||
expect(result.tags).toContainEqual(["k", "1"]);
|
||||
expect(result.tags).toContainEqual(["k", "3"]);
|
||||
expect(result.tags).toContainEqual(["k", "7"]);
|
||||
|
||||
@@ -6,7 +6,6 @@ import type {
|
||||
SpellEvent,
|
||||
} from "@/types/spell";
|
||||
import type { NostrFilter } from "@/types/nostr";
|
||||
import { GRIMOIRE_CLIENT_TAG } from "@/constants/app";
|
||||
|
||||
/**
|
||||
* Simple tokenization that doesn't expand shell variables
|
||||
@@ -115,10 +114,8 @@ export function encodeSpell(options: CreateSpellOptions): EncodedSpell {
|
||||
}
|
||||
|
||||
// Start with required tags
|
||||
const tags: [string, string, ...string[]][] = [
|
||||
["cmd", cmdType],
|
||||
GRIMOIRE_CLIENT_TAG,
|
||||
];
|
||||
// Note: Client tag is added by publish-spell.ts based on user settings
|
||||
const tags: [string, string, ...string[]][] = [["cmd", cmdType]];
|
||||
|
||||
// Add name tag if provided
|
||||
if (name && name.trim().length > 0) {
|
||||
|
||||
Reference in New Issue
Block a user