Repository navigation
Fix blank Organization embed of local openXYOS - #44
Merged
Merged
Conversation
Always allow the sidecar listen origin even when CORS_ORIGIN is stale, replace a day-old FreeOS-openxyos Node on start, heal nested live layouts, and surface a preview error when livez is up but self-origin asset requests fail. Co-authored-by: XYAI Labs <haoboy8@gmail.com>
Tighten the stale-whitelist assertion so reqHost matching one listen host does not imply every self-origin is allowed, and apply ruff/prettier on the start/heal helpers. Co-authored-by: XYAI Labs <haoboy8@gmail.com>
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.
Summary
Organization can show 本机 openXYOS 已连接 while the iframe stays white. On the user’s Windows machine, livez was fine and
http://127.0.0.1:3780/returned HTML, but a day-old sidecar Node still used a staleCORS_ORIGINthat rejected its own origin (Origin: http://127.0.0.1:3780). Module/CSS/font/login requests then 500’d and the preview stayed blank.This PR makes that failure mode durable to fix:
mergeCorsOrigins/corsAllowsSelfalways addhttp://127.0.0.1:<PORT>,http://localhost:<PORT>, andhttp://[::1]:<PORT>even whenCORS_ORIGINonly lists dashboard ports (8088 / 18900 / …).liveznow reportsself_origin_allowed.start-sidecar.ps1no longer exits early just because livez is up. It stops the previous FreeOS-openxyos Node under the live dir (start.pid+ bundlednode.exe), then starts with the shipped env/CORS list. Desktop Go and the Python helper do the same; Windows prefers the currentstart-sidecar.ps1.openxyos\dist\index.html(or a deeper nest) but is missing top-leveldist\index.html/backend-dist\server.js, promote/copy the same way asRepair-OpenXYOSLayout.Does not change the install-tar / stop-before-extract path (that work is in another agent).
Test plan
Verified on this revision:
npx tsx scripts/test-cors-origins.ts(openXYOS) — passedpython -m pytest tests/unit/test_sidecar_launch.py tests/unit/test_org_module.py tests/unit/desktop/test_openxyos_provisioner.py tests/unit/desktop/test_nsis_uninstall.py -q— 65 passedcd dashboard && npx vitest run src/pages/Organization src/layouts/sidebarNav.test.ts— 15 passedcd dashboard && npx tsc --noEmit— passedmypy --strictonsidecar_launch.py/service.py/overview.py— passedgo testcannot run in this image (missing GTK4 / WebKitGTK). New cases are inprocess_sidecar_test.go.Target branch
main(requested)Type of change