Skip to content

Fix link-resource gate on Qortal Hub + Hub-contract attachments smoke - #107

Merged
QuickMythril merged 2 commits into
mainfrom
fix/hub-link-gate-and-smoke
Sep 1, 2026
Merged

Fix link-resource gate on Qortal Hub + Hub-contract attachments smoke#107
QuickMythril merged 2 commits into
mainfrom
fix/hub-link-gate-and-smoke

Conversation

@QuickMythril

Copy link
Copy Markdown
Member

What

Follow-up to #105/#106, produced by the Hub smoke run.

  • Bug fix (caught by the smoke): real Hub's SHOW_ACTIONS has no FETCH_NODE_API entry — its node API reach comes from Chat's same-origin fallback — so the new 🔗 button, gated on that action, was disabled on the very host A3 most targets. New canFetchNodeApi(bridge) in chatNetwork.ts accepts host === 'hub' and transport === 'gateway' alongside the advertised action; App gates on it with the conversation-network's bridge state. Unit-tested.
  • New smoke: npm run smoke:hub-attachments (scripts/smoke-hub-attachments.mjs) — headless Chromium + CDP against a window.qortalRequest shim mirroring real Hub's contract as read from Hub source (actual SHOW_ACTIONS slice, inline-bytes PUBLISH_QDN_RESOURCE, same-origin node API; no SELECT_QDN_PUBLISH_SOURCE, no PUBLISH_CHAT_ATTACHMENT). It asserts the full A1–A4 flow in a Qortal open group:
    1. paperclip + link buttons enabled (bytes path + node-API reach),
    2. pasting a PNG stages it (tiny.png · 70 B chip),
    3. Send publishes inline base64+filename (service IMAGE, publisher name, qtm-chat_group_12_… identifier, no sourceToken) and the chat message goes out in Hub's v3 envelope with qortal://use-embed/IMAGE?name=…&service=IMAGE&identifier=… in messageText,
    4. the link dialog searches /arbitrary/resources/search and inserts qortal://use-embed/IMAGE?name=alice&service=IMAGE&identifier=pic-1 into the draft.

Verification

tsc clean; 57 files / 770 tests pass; build OK; smoke passes (screenshot verified: composer, staged chip, sent message, dialog insertion all correct).

Caveat: like the other smoke:* scripts this runs in no CI (known rot risk) — worth running manually before each release. It exercises Hub's contract; a pass on the real Hub app with a live node remains the final acceptance.

🤖 Generated with Claude Code

https://claude.ai/code/session_01E9yvpqkVaKzM9MUh5zoCmG

QuickMythril and others added 2 commits September 1, 2026 15:04
…hments smoke

Real Hub's SHOW_ACTIONS does not include FETCH_NODE_API (its node fetch
rides Chat's same-origin fallback), so gating the composer's link button on
that action left it dead on Hub. canFetchNodeApi(bridge) now accepts
host==='hub' and transport==='gateway' alongside the advertised action.

scripts/smoke-hub-attachments.mjs (npm run smoke:hub-attachments) drives
the built app in headless Chromium against a qortalRequest shim that
mirrors real Hub's contract (its actual SHOW_ACTIONS list, inline-bytes
PUBLISH_QDN_RESOURCE, same-origin node API) and asserts the A1-A4 flow:
attach + link buttons enabled, pasted file staged, publish sent as inline
base64 with no sourceToken, message text carrying the
qortal://use-embed/IMAGE link inside Hub's v3 envelope, and the link
dialog searching /arbitrary/resources/search and inserting a use-embed
link. This smoke caught the gate bug above.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E9yvpqkVaKzM9MUh5zoCmG
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E9yvpqkVaKzM9MUh5zoCmG
@QuickMythril
QuickMythril merged commit 75ff6cb into main Sep 1, 2026
4 checks passed
@QuickMythril
QuickMythril deleted the fix/hub-link-gate-and-smoke branch September 1, 2026 19:10
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.

1 participant