Skip to content

fix: parse new chat_module JSON bundle event (Get Intro Bundle is broken) - #24

Open
xAlisher wants to merge 1 commit into
logos-co:masterfrom
xAlisher:fix/parse-bundle-event
Open

xAlisher wants to merge 1 commit into
logos-co:masterfrom
xAlisher:fix/parse-bundle-event

Conversation

@xAlisher

Copy link
Copy Markdown

Problem

ChatBackend::onChatCreateIntroBundleResult reads the bundle event as a legacy
[bool, int, string, …] array (data[0].toBool(), data[2].toString()). But the current
chat_module (logos-chat-module, latest) emits the event as a single JSON string:

deferredEmit(impl, "chatCreateIntroBundleResult", ev.dump());   // {"success":…,"introBundle":…,…}

So success parses as false and every "Get Intro Bundle" fails with "Failed to create
intro bundle" — even though the module created the bundle successfully (verified: chat_module
logs IntroBundleCreated, ret 0).

Fix

Parse data[0] as JSON ({"success", "introBundle"}), falling back to the legacy array
format for older chat_module builds. One-file change in ChatBackend.cpp.

Independent of any feature — this unblocks the intro-bundle flow against the current chat_module.

The current chat_module emits chatCreateIntroBundleResult as a single JSON string;
ChatBackend still read the legacy [bool,int,str] array → always 'Failed to create
intro bundle'. Parse JSON, fall back to the array format. (Separate from the QR card.)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants