Files
illusory-iotam/memory.log.md
user 92deee1b2e Implement frontend session routing flow
- Validate and prepare access links in apps/frontend
- Add session, ended, and unauthorized routes with polling
- Copy full public access URLs from the admin links page
2026-03-28 19:10:24 +02:00

87 lines
4.8 KiB
Markdown

# Purpose
- Keep a concise, append-only timeline of meaningful product, schema, UI, and flow changes.
- Preserve enough context so future work can quickly recover what was completed.
Update rule:
- Append a new numbered section for meaningful completed work.
- Keep entries factual and grouped; avoid file-by-file noise.
---
### 0 — Genesis
- Repository initialized.
### 1 — Foundation & Core Domain Setup
- Rewrote project guidance docs (`CLAUDE.md`, `README.md`) and established the implementation checklist.
- Implemented initial `device` and `link` domains across DB + logic layers (`data`, `errors`, `repository`, `controller`).
- Established link token lifecycle flows: create/generate, validate, assign, revoke.
### 2 — Admin CRUD + Dashboard Evolution
- Built admin CRUD flows for devices and links using remote functions + VM pattern.
- Added device detail experience with metadata/actions + embedded live stream viewer.
- Introduced shared device form and enabled editing from both list and detail surfaces.
- Merged legacy `/devices` area into `/dashboard` and moved device detail routes under `/dashboard/[id]`.
- Improved details-page layout density and stream viewport behavior.
### 3 — Device/Link Model Maturation
- Added device occupancy state (`inUse`) and surfaced it in admin list/detail views.
- Made connection fields (`containerId`, `wsPort`) required end-to-end to match schema constraints.
- Shifted link creation from freeform app data to controlled app selection.
- Added normalized `supported_app` schema/domain + admin CRUD page, then refactored links to use `supportedAppId`.
- Updated README flow to reflect app-leasing behavior and explicit device allocation/release expectations.
### 4 — Streaming Infrastructure & URL Correctness
- Added ws-scrcpy container build/runtime setup and deployed behind Traefik.
- Resolved Node/runtime/networking issues and brought redroid streaming online.
- Replaced incorrect viewer URL assembly with the correct ws-scrcpy hash/proxy stream builder.
- Clarified separation between internal ADB endpoint fields (`host` + `wsPort`) and public stream domain.
### 5 — Front/Orchestrator Session Lifecycle
- Implemented link resolve/prepare server flow across front and orchestrator services.
- Added orchestrator internal API auth + device routes + session-prepare endpoint.
- Implemented session prepare behavior: allocate device, run ADB connect/force-stop/launch, release on failure.
- Added atomic `allocateIfAvailable` path in logic to avoid concurrent allocation race conditions.
### 6 — Architecture Refactors (Orchestrator, Front, Frontend)
- Refactored orchestrator into thin entrypoint + domain routers/services + shared core request/auth helpers.
- Split low-level command execution (ADB/app-launch) from orchestration coordination responsibilities.
- Refactored front app into thin entrypoint + domain service/router/core utilities.
- Migrated frontend link flows into SvelteKit remote functions and aligned `FlowExecCtx` construction.
- Reduced remote layer to thin entrypoints by moving link/orchestrator/domain logic into dedicated modules.
### 7 — Type Hygiene & Stability Fixes
- Removed duplicated frontend domain types and reused canonical `@pkg/logic` types/schemas.
- Fixed stale links refresh behavior caused by cached SvelteKit `query()` objects via explicit `query.refresh()`.
- Fixed Hono status/body typing issues across front/orchestrator and excluded legacy prototype server file from TS checks.
- Fixed historical `/links` auth path-matching bug and earlier device table refresh issue.
### 8 — Memory Log Condensation (Grouped)
- Re-condensed timeline from many micro-numbered entries into broader milestone groups.
- Restored important implementation details while keeping the log substantially shorter and easier to scan.
### 9 — Frontend Session Routing + Live Revocation Polling
- Implemented token-gated frontend flow: `/` now validates + prepares link sessions and redirects to `/session` only after orchestrator preparation succeeds.
- Added explicit failure routes for invalid access and terminated sessions (`/unauthorized`, `/session-ended`) with reason-based messaging.
- Added session runtime polling (2s interval with forced query refresh + network failure tolerance) that ejects users immediately when link validity is lost.
- Extended link resolve payload with server-built ws-scrcpy stream URL data so the session route can render the active stream without exposing raw device details in the URL.
### 10 — Frontend De-Branding Cleanup
- Removed temporary `IOTAM` label text from session loading and failure pages to keep user-facing frontend copy generic.
### 11 — Admin Link Copy Full URL
- Refactored admin links-page copy action to copy full public frontend access URLs (`PUBLIC_FRONTEND_URL?token=...`) instead of raw tokens.