mirror of
https://github.com/purrgrammer/grimoire.git
synced 2026-04-12 08:27:27 +02:00
Replaced action-based self-chat with direct implementation using publishEventToRelays. This eliminates the dependency on patched node_modules and provides a more robust solution. **Why This Change:** The previous approach relied on patching applesauce-actions in node_modules to fix the relay hint bug. This patch would be lost on every npm install, making it fragile and non-reproducible. **New Self-Chat Flow:** 1. Create rumor using WrappedMessageBlueprint (kind 14) 2. Wrap rumor using GiftWrapBlueprint (kind 1059) 3. Persist encrypted content to Dexie BEFORE publishing 4. Publish directly to inbox relays using publishEventToRelays 5. Add to EventStore for immediate local availability **Benefits:** - ✅ No dependency on node_modules patches - ✅ Guaranteed to work across npm installs - ✅ Direct control over relay selection - ✅ Encrypted content persisted before publish (no race conditions) - ✅ Clean separation: self-chat vs group chat logic **Non-Self-Chat:** Still uses SendWrappedMessage action (with patched applesauce for now). Future work: Extend custom implementation to all message types. **Testing:** Self-chat messages should now: - Appear live within 500ms (no manual sync) - Persist across page reloads - Match subscribed relay URLs exactly - Include proper console logging at each step Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>