fix: iframe embed islands use wrong URL pattern for hero_router #43
Labels
No labels
prio_critical
prio_low
type_bug
type_contact
type_issue
type_lead
type_question
type_story
type_task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lhumina_code/hero_archipelagos#43
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
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?
Problem
Several iframe embed islands use the legacy URL pattern
/<service>_ui(e.g./hero_proc_ui) instead of the hero_router convention/<service>/ui/(e.g./hero_proc/ui/).hero_router maps
/<service_name>/<socket_type>/to the corresponding Unix socket at$HERO_SOCKET_DIR/<service_name>/<socket_type>.sock. The_uisuffix pattern does not match any route and returns 404.Affected islands
archipelagos/embed/proc/src/island.rs:44/hero_proc_ui/hero_proc/ui/archipelagos/embed/compute/src/island.rs:43/hero_compute_ui/hero_compute/ui/archipelagos/embed/embedder/src/island.rs:43/hero_embedder_ui/hero_embedder/ui/archipelagos/embed/books/src/island.rs:28/hero_books_ui/hero_books/ui/archipelagos/embed/indexer/src/island.rs:43/hero_indexer_ui/hero_indexer/ui/archipelagos/embed/redis/src/island.rs:46/hero_db_ui/hero_db/ui/archipelagos/embed/auth/src/island.rs:43/hero_auth_ui/hero_auth/ui/archipelagos/embed/office/src/island.rs:17/hero_office/hero_office/ui/archipelagos/embed/aibroker/src/island.rs:43/hero_aibroker/hero_aibroker/ui/archipelagos/embed/inspector/src/island.rs:43/hero_router/hero_router/ui/Fix
Each affected island needs a one-line change in
island.rs— replace theformat!("{}/hero_<name>_ui", ...)withformat!("{}/hero_<name>/ui/", ...).Also ensure all URLs end with a trailing
/to avoid unnecessary 308 redirects from hero_router.How to verify
Implementation Spec for Issue #43
Objective
Fix the iframe embed islands so their iframe
srcURLs use the hero_router URL convention/<service>/ui/(with trailing slash) instead of the legacy/<service>_uipattern that does not map to any hero_router route and returns 404.Requirements
format!in each of the 10 affectedisland.rsfiles so the iframe requests a URL that hero_router can route to a Unix socket under$HERO_SOCKET_DIR/<service>/ui.sock./to avoid unnecessary 308 redirects from hero_router.cargo build) and tests must still pass (cargo test) after the edits.Files to Modify
archipelagos/embed/proc/src/island.rs— fix proc iframe URL (line 46)archipelagos/embed/compute/src/island.rs— fix compute iframe URL (line 45)archipelagos/embed/embedder/src/island.rs— fix embedder iframe URL (line 45)archipelagos/embed/books/src/island.rs— fix books base URL (line 28)archipelagos/embed/indexer/src/island.rs— fix indexer iframe URL (line 45)archipelagos/embed/redis/src/island.rs— fix redis (hero_db) iframe URL (line 48)archipelagos/embed/auth/src/island.rs— fix auth iframe URL (line 45)archipelagos/embed/office/src/island.rs— fix office iframe URL (line 17)archipelagos/embed/aibroker/src/island.rs— fix aibroker iframe URL (line 45)archipelagos/embed/inspector/src/island.rs— fix hero_router iframe URL (line 45)Implementation Plan
Step 1: Update proc island URL
Files:
archipelagos/embed/proc/src/island.rsformat!("{}/hero_proc_ui", props.context.api_host)withformat!("{}/hero_proc/ui/", props.context.api_host)at line 46Dependencies: none
Step 2: Update compute island URL
Files:
archipelagos/embed/compute/src/island.rsformat!("{}/hero_compute_ui", props.context.api_host)withformat!("{}/hero_compute/ui/", props.context.api_host)at line 45Dependencies: none
Step 3: Update embedder island URL
Files:
archipelagos/embed/embedder/src/island.rsformat!("{}/hero_embedder_ui", props.context.api_host)withformat!("{}/hero_embedder/ui/", props.context.api_host)at line 45Dependencies: none
Step 4: Update books island base URL
Files:
archipelagos/embed/books/src/island.rsformat!("{}/hero_books_ui", props.context.api_host)withformat!("{}/hero_books/ui/", props.context.api_host)at line 28Dependencies: none
Step 5: Update indexer island URL
Files:
archipelagos/embed/indexer/src/island.rsformat!("{}/hero_indexer_ui", props.context.api_host)withformat!("{}/hero_indexer/ui/", props.context.api_host)at line 45Dependencies: none
Step 6: Update redis (hero_db) island URL
Files:
archipelagos/embed/redis/src/island.rsformat!("{}/hero_db_ui", props.context.api_host)withformat!("{}/hero_db/ui/", props.context.api_host)at line 48Dependencies: none
Step 7: Update auth island URL
Files:
archipelagos/embed/auth/src/island.rsformat!("{}/hero_auth_ui", props.context.api_host)withformat!("{}/hero_auth/ui/", props.context.api_host)at line 45Dependencies: none
Step 8: Update office island URL
Files:
archipelagos/embed/office/src/island.rsformat!("{}/hero_office", props.context.api_host)withformat!("{}/hero_office/ui/", props.context.api_host)at line 17Dependencies: none
Step 9: Update aibroker island URL
Files:
archipelagos/embed/aibroker/src/island.rsformat!("{}/hero_aibroker", props.context.api_host)withformat!("{}/hero_aibroker/ui/", props.context.api_host)at line 45Dependencies: none
Step 10: Update inspector island URL
Files:
archipelagos/embed/inspector/src/island.rsformat!("{}/hero_router", props.context.api_host)withformat!("{}/hero_router/ui/", props.context.api_host)at line 45Dependencies: none
Step 11: Build verification
Files: none
cargo build --workspaceat the repo root and confirm it succeeds.Dependencies: Steps 1-10
Step 12: Test verification
Files: none
cargo test --workspaceat the repo root and confirm tests pass.curl -sL http://127.0.0.1:9988/<service>/ui/ -o /dev/null -w "%{http_code}\n"should return 200 for each of the 10 services.Dependencies: Step 11
Acceptance Criteria
/<service>/ui/pattern with trailing slashNotes
_uipatterns found hits inarchipelagos/system/service/src/island.rsandarchipelagos/system/services/src/island.rs(plussrc/lib.rs). These are doc comments / module-level comments only — the actual iframe URLs in both files already use the correct/hero_proc/ui/pattern. Updating those stale doc comments is out of scope for this issue; leave them alone to keep the PR minimal and focused.inspectorisland embedshero_routeritself — verify manually that hero_router exposes a/hero_router/ui/route. If hero_router's UI is not under/hero_router/ui/in the running deployment, that would be a separate routing-registration issue, not a fix to the island code.base_urlused by nested views that build URLs like{base_url}/api/.... After the fix, downstream URLs will become<api_host>/hero_books/ui/api/..., which assumes hero_books_server exposes its API under/ui/— confirm that during smoke testing.Pull request opened (WIP): #67
This PR implements the URL-pattern fix discussed in this issue. It is marked work-in-progress while we complete a follow-up linkage change so the 9 unlinked embed islands (proc, compute, embedder, indexer, redis, auth, aibroker, inspector, office) are actually rendered by the showcase server.