Skip to content

feat(remote-connect): carry the relay service version as a query parameter - #3808

Merged
bobleer merged 1 commit into
GCWing:mainfrom
bobleer:feat/relay-endpoint-version-query
Nov 7, 2026
Merged

bobleer merged 1 commit into
GCWing:mainfrom
bobleer:feat/relay-endpoint-version-query

Conversation

@bobleer

@bobleer bobleer commented Nov 7, 2026

Copy link
Copy Markdown
Collaborator

What

Moves the official Relay endpoint from a versioned path to a versioned query:

https://remote.openbitfun.com/v/1.0.2   ->   https://remote.openbitfun.com/relay?v=1.0.9

One proxy location now serves every build, and the bare origin is the account
controller, so a release no longer needs its own location and an invitation can
be opened without knowing a version path.

Compatibility

/v/1.0.2/ stays live on the same process and database. Both paths are one
deployment
: a stored token, master key, or device registration from either
alias keeps working, and neither is reported as retired. is_retired_official_relay
now treats both live aliases as current and still retires any other /v/<release>.

How the version is handled

  • product-domains owns the helpers: relay_endpoint_base (drops version,
    query, fragment, trailing slash), relay_endpoint_version,
    same_relay_deployment, relay_page_url.
  • Validation accepts exactly one v=<version> parameter and rejects every other
    query content, so the query can never carry per-request data. Rust, Kotlin,
    and ArkTS validators implement the same rule.
  • Every path join uses the base (join_relay_url, page URLs, socket path, RPC
    payload endpoint). Only user-facing links keep ?v=, and it stays before the
    fragment: .../relay/?v=1.0.9#/pair?did=....
  • Mobile clients keep the base as the stored/comparison identity and expose the
    versioned string as the user-facing endpoint; both accept invitations from
    either live alias.

Pages origin

Deployment now serves /p/ from a separate browser origin. A Page document
executes user-authored JavaScript and must not share storage with the controller
that holds the device key and Relay credential. The template documents the query
endpoint, the bare-origin controller, and the old-path redirect.

Verification

cargo test -p openbitfun-product-domains --lib -- relay_endpoint_tests
cargo test -p openbitfun-services-integrations --features remote-connect --lib
cargo test -p openbitfun-services-integrations --features remote-connect --test remote_connect_contracts
pnpm --dir src/mobile-web run test:account-login
pnpm --dir src/mobile-web run type-check
npx vitest run src/infrastructure/remote-connect  # web-ui

Kotlin and ArkTS suites were not executed locally; their assertions were updated
to the same rules.

@bobleer
bobleer force-pushed the feat/relay-endpoint-version-query branch 3 times, most recently from 8f730b5 to de88c27 Compare November 7, 2026 18:00
…meter

The official endpoint moves from a versioned path to a versioned query:
`https://remote.openbitfun.com/relay?v=1.0.9`. One proxy location now serves
every build, and the bare origin is the account controller, so a release no
longer needs its own location and an invitation can be opened without knowing
a version path.

`/v/1.0.2/` stays live on the same process and database. Both paths are one
deployment: a stored token, master key, or device registration from either
alias keeps working, and neither is reported as retired. Compatibility is
enforced end to end:

- product-domains owns the endpoint helpers: base extraction (version, query,
  fragment removed), version reading, live-alias deployment comparison, and
  page URLs that keep `?v=` before the fragment.
- URL validation accepts exactly one `v=<version>` parameter and rejects every
  other query, so the query can never carry per-request data. Rust, Kotlin, and
  ArkTS validators follow the same rule.
- Path joins (`join_relay_url`, page URLs, socket paths, RPC payload endpoints)
  always use the base, never the versioned string.
- Pairing links keep the version before the fragment, and both mobile clients
  accept invitations from either live alias.

Published Pages are served from a separate browser origin in deployment: a Page
document executes user-authored JavaScript and must not share storage with the
controller that holds the device key. The deploy template documents the query
endpoint, the bare-origin controller, and the `/p/` redirect.

Verified with `cargo test -p openbitfun-product-domains`,
`cargo test -p openbitfun-services-integrations --features remote-connect`,
mobile-web `test:account-login`, and the web-ui relay endpoint tests.
@bobleer
bobleer force-pushed the feat/relay-endpoint-version-query branch from de88c27 to 5396ee2 Compare November 7, 2026 18:00
@bobleer
bobleer merged commit 63e6810 into GCWing:main Nov 7, 2026
13 checks passed
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