DM drafts share key #262
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description
When composing a direct message to a user where no previous conversation history exists, the local draft is saved under the key
dm:undefined. Because all new, empty conversations resolve to this same draft key, a draft written in one empty conversation will leak into another empty conversation.Code References
Chat.svelte(Line 70): The draft key is initialized asconst draftKey = new DraftKey<{...}>(`dm:${$chat?.id}`). Because this runs once on mount,$chatevaluates toundefinedfor new conversations.ChatCompose.svelte(Lines 37-38 & 99): The compose box reads from and writes to this shareddraftKey.drafts.ts:DraftKeyuses a global Map, meaningdm:undefinedis a globally shared slot.Privacy Leak: New DM Drafts Share the Same Key (`dm:undefined`)to DM drafts share keyFixed in
8f56812d