Fix link-resource gate on Qortal Hub + Hub-contract attachments smoke - #107
Merged
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Follow-up to #105/#106, produced by the Hub smoke run.
SHOW_ACTIONShas noFETCH_NODE_APIentry — 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. NewcanFetchNodeApi(bridge)inchatNetwork.tsacceptshost === 'hub'andtransport === 'gateway'alongside the advertised action; App gates on it with the conversation-network's bridge state. Unit-tested.npm run smoke:hub-attachments(scripts/smoke-hub-attachments.mjs) — headless Chromium + CDP against awindow.qortalRequestshim mirroring real Hub's contract as read from Hub source (actualSHOW_ACTIONSslice, inline-bytesPUBLISH_QDN_RESOURCE, same-origin node API; noSELECT_QDN_PUBLISH_SOURCE, noPUBLISH_CHAT_ATTACHMENT). It asserts the full A1–A4 flow in a Qortal open group:tiny.png · 70 Bchip),base64+filename(service IMAGE, publisher name,qtm-chat_group_12_…identifier, no sourceToken) and the chat message goes out in Hub's v3 envelope withqortal://use-embed/IMAGE?name=…&service=IMAGE&identifier=…inmessageText,/arbitrary/resources/searchand insertsqortal://use-embed/IMAGE?name=alice&service=IMAGE&identifier=pic-1into the draft.Verification
tscclean; 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