Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
bbf3c55
test: add unit test for localhost hostname matching in network adapte…
JanZachmann Jan 17, 2026
1da57b8
fix: add missing ViewModel field synchronization for e2e tests
JanZachmann Jan 17, 2026
d904264
fix: clear rollback modal flag after network config is applied
JanZachmann Jan 17, 2026
e3be467
fix: only match current connection adapter by direct IP comparison
JanZachmann Jan 17, 2026
4bc5dfd
test: fix and unskip DHCP configuration tests
JanZachmann Jan 17, 2026
9dd4d96
test: fix gateway readonly and current connection detection tests
JanZachmann Jan 17, 2026
eef55b0
test: unskip tab switching with unsaved changes test
JanZachmann Jan 17, 2026
49d005a
test: unskip form reset button test
JanZachmann Jan 17, 2026
d08cc74
test: unskip form field caret stability regression test
JanZachmann Jan 17, 2026
3f4086a
test: unskip and fix DHCP rollback timeout test
JanZachmann Jan 17, 2026
c805748
test: refactor click workarounds to use dispatchEvent
JanZachmann Jan 17, 2026
6a99293
test: add e2e test for omnect-device-service version mismatch
JanZachmann Jan 18, 2026
b02e3c3
fix(ui): delay network rollback modal until save is clicked
JanZachmann Jan 18, 2026
0e39ce8
test: use standard click in network rollback tests
JanZachmann Jan 18, 2026
1576956
test: replace dispatchEvent with standard click in all network tests
JanZachmann Jan 18, 2026
21f84d9
test: finish replacing dispatchEvent in network-rollback tests
JanZachmann Jan 18, 2026
7bb6631
fix: enable rollback modal on any network change and improve types
JanZachmann Jan 18, 2026
1866e2e
fix: show rollback modal instead of snackbar on dynamic rollback
JanZachmann Jan 18, 2026
a081ffd
test(refactor): consolidate and cleanup network rollback tests
JanZachmann Jan 18, 2026
d15d0a5
test(refactor): cleanup comprehensive network tests and remove redund…
JanZachmann Jan 18, 2026
6017bcc
fix: ensure rollback overlay appears when explicitly enabled
JanZachmann Jan 18, 2026
5f72c35
fix: ensure network rollback modal closes on consecutive updates
JanZachmann Jan 19, 2026
72189a7
fix: resolve network configuration endless progress bug and refactor …
JanZachmann Jan 19, 2026
7789d02
perf: reduce E2E test time by making polling intervals configurable
JanZachmann Jan 19, 2026
6ccf0d3
docs: update project structure in documentation
JanZachmann Jan 19, 2026
12365fd
test: add E2E tests for device reboot functionality
JanZachmann Jan 19, 2026
3a2f4a5
test: add E2E tests for device factory reset functionality
JanZachmann Jan 19, 2026
ac44ee3
test: add E2E test for firmware update success scenario
JanZachmann Jan 19, 2026
691e51f
test: consolidate E2E test setup logic into shared helper
JanZachmann Jan 19, 2026
5aa20e0
build: upgrade Crux framework to 0.17 and align Core/Shell architecture
JanZachmann Jan 19, 2026
c53c202
build: upgrade crux_http and remove error status masking workaround
JanZachmann Jan 19, 2026
64cdffd
chore: remove CLAUDE.md and GEMINI.md from version control
JanZachmann Jan 20, 2026
999f484
test: fix authentication e2e tests and mock portal auth
JanZachmann Jan 20, 2026
47b2e2d
fix(ui): decouple password setup logic from message notifications
JanZachmann Jan 20, 2026
1dcdcf2
build: reorganize scripts and improve execution portability
JanZachmann Jan 20, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
292 changes: 91 additions & 201 deletions Cargo.lock

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,16 @@ omnect-ui/
├── src/
│ ├── backend/ # Rust backend (Actix-web)
│ ├── app/ # Crux Core (business logic)
│ │ ├── src/
│ │ │ ├── commands/ # Custom side-effect commands
│ │ │ └── ...
│ ├── shared_types/ # TypeGen for TypeScript bindings
│ └── ui/ # Vue 3 frontend
├── scripts/ # Build and development scripts
│ └── build-frontend.sh # Build WASM + TypeScript types + UI
│ └── setup-centrifugo.sh # Download script for Centrifugo
├── tools/ # Development tools
│ ├── centrifugo # WebSocket server binary (gitignored)
│ └── setup-centrifugo.sh # Download script for Centrifugo
├── Dockerfile # Multi-stage Docker build
└── build-and-deploy-image.sh # Build and deployment script
```
Expand Down
30 changes: 16 additions & 14 deletions scripts/run-e2e-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ set -e

# Internal script to run E2E tests inside the container

# Navigate to repository root (parent of scripts directory)
REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
cd "$REPO_ROOT"

# Cleanup function to kill spawned processes
cleanup() {
echo "🧹 Cleaning up processes..."
Expand All @@ -20,22 +24,14 @@ pkill -9 -f "bun run.*5173" 2>/dev/null || true
pkill -9 -f "node.*vite.*5173" 2>/dev/null || true
sleep 2

# 1. Ensure bun is installed (needed for UI)
# 1. Ensure bun is installed (needed for building and running UI)
if ! command -v bun &> /dev/null; then
echo "⚠️ Bun not found, installing..."
curl -fsSL https://bun.sh/install | bash
export BUN_INSTALL="$HOME/.bun"
export PATH="$BUN_INSTALL/bin:$PATH"
echo "❌ bun not found in PATH."
exit 1
fi

# 2. Ensure Centrifugo is available (using the tool script if needed)
if ! command -v centrifugo &> /dev/null; then
echo "⚠️ Centrifugo not found in PATH, checking tools directory..."
if [ ! -f "tools/centrifugo" ]; then
./tools/setup-centrifugo.sh
fi
export PATH=$PATH:$(pwd)/tools
fi
# 2. Ensure Centrifugo is available
./scripts/setup-centrifugo.sh

# 3. Start Centrifugo directly (Backend is mocked, but we need real WS)
echo "🚀 Starting Centrifugo..."
Expand Down Expand Up @@ -65,7 +61,7 @@ export CENTRIFUGO_CLIENT_TOKEN_HMAC_SECRET_KEY="secret"
export CENTRIFUGO_HTTP_API_KEY="api_key"
export CENTRIFUGO_LOG_LEVEL="info"

centrifugo -c "$CENTRIFUGO_CONFIG" > /tmp/centrifugo.log 2>&1 &
./tools/centrifugo -c "$CENTRIFUGO_CONFIG" > /tmp/centrifugo.log 2>&1 &
CENTRIFUGO_PID=$!

echo "⏳ Waiting for Centrifugo..."
Expand Down Expand Up @@ -106,6 +102,12 @@ fi
# Build the frontend for preview mode (eliminates Vite dev optimization issues)
# Note: Using default base path (/) for preview server, not /static for production backend
echo "🏗️ Building frontend..."
# Faster polling for E2E tests
export VITE_RECONNECTION_POLL_INTERVAL_MS=500
export VITE_NEW_IP_POLL_INTERVAL_MS=500
export VITE_REBOOT_TIMEOUT_MS=2000
export VITE_FACTORY_RESET_TIMEOUT_MS=500

if bun run build-preview > /tmp/vite-build.log 2>&1; then
echo "✅ Frontend build complete!"
else
Expand Down
9 changes: 8 additions & 1 deletion tools/setup-centrifugo.sh → scripts/setup-centrifugo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,17 @@

set -e

# Navigate to repository root (parent of scripts directory)
REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
cd "$REPO_ROOT"

CENTRIFUGO_VERSION="${CENTRIFUGO_VERSION:-v6.1.0}"
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
SCRIPT_DIR="tools"
CENTRIFUGO_BIN="$SCRIPT_DIR/centrifugo"

# Create directory if it doesn't exist
mkdir -p "$SCRIPT_DIR"

if [[ -f "$CENTRIFUGO_BIN" ]]; then
echo "Centrifugo already exists at $CENTRIFUGO_BIN"
"$CENTRIFUGO_BIN" version 2>/dev/null || true
Expand Down
10 changes: 7 additions & 3 deletions scripts/test-e2e-in-container.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ set -e

# Host script to run E2E tests inside the docker container

IMAGE="omnectshareddevacr.azurecr.io/rust:bookworm"
# Navigate to repository root (parent of scripts directory)
REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
cd "$REPO_ROOT"

IMAGE="omnectweucopsacr.azurecr.io/rust:bookworm"

echo "🐳 Launching test container..."

Expand All @@ -14,9 +18,9 @@ if [ ! -d "src/ui/dist" ]; then
fi

# Run the test script inside the container
# We mount the current directory to /workspace
# We mount the repository root to /workspace
docker run --rm \
-v $(pwd):/workspace \
-v "$REPO_ROOT":/workspace \
-w /workspace \
--net=host \
$IMAGE \
Expand Down
8 changes: 5 additions & 3 deletions src/app/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,15 @@ unexpected_cfgs = { level = "warn", check-cfg = ['cfg(feature, values("facet_typ
[dependencies]
base64 = { version = "0.22", default-features = false, features = ["alloc"] }
console_log = { version = "1.0", default-features = false }
crux_core = { version = "0.16", default-features = false }
crux_http = { version = "0.15", default-features = false }
crux_core = { version = "0.17.0-rc2" }
crux_http = { version = "0.16.0-rc2", default-features = false }
crux_macros = { version = "0.8.0-rc2" }
lazy_static = { version = "1.4", default-features = false }
log = { version = "0.4", default-features = false }
getrandom = { version = "0.3", features = ["wasm_js"] }
serde = { version = "1.0", default-features = false, features = ["derive"] }
serde_json = { version = "1.0", default-features = false }
wasm-bindgen = { version = "0.2", default-features = false }

[build-dependencies]
crux_core = { version = "0.16", default-features = false, features = ["typegen"] }
crux_core = { version = "0.17.0-rc2", default-features = false, features = ["typegen"] }
33 changes: 9 additions & 24 deletions src/app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ The Crux Core follows the Model-View-Update pattern:
- **Model** - The complete application state (auth, device info, network status, etc.)
- **ViewModel** - Data needed by the UI to render
- **Events** - Actions that can occur in the application
- **Capabilities** - Side effects (HTTP requests, WebSocket, rendering)
- **Effects** - Side effects (HTTP requests, WebSocket, rendering)

## Key Files

- `src/lib.rs` - App struct, Capabilities, and re-exports
- `src/lib.rs` - App struct, Effect enum, and re-exports
- `src/model.rs` - Model and ViewModel structs
- `src/events.rs` - Event enum definitions
- `src/types/` - Domain-based type definitions
Expand All @@ -31,12 +31,15 @@ The Crux Core follows the Model-View-Update pattern:
- `device/` - Device action handlers
- `mod.rs` - Device event dispatcher
- `operations.rs` - Device operations (reboot, factory reset, updates)
- `network.rs` - Network configuration handlers
- `reconnection.rs` - Device reconnection handlers
- `network/` - Network configuration handlers
- `mod.rs` - Module re-exports
- `config.rs` - Network config request/response
- `form.rs` - Form state management
- `verification.rs` - IP check and rollback logic
- `websocket.rs` - WebSocket/Centrifugo handlers
- `ui.rs` - UI action handlers (clear error/success)
- `src/capabilities/centrifugo.rs` - Custom WebSocket capability (deprecated API, kept for Effect enum generation)
- `src/capabilities/centrifugo_command.rs` - Command-based WebSocket capability (new API)
- `src/commands/centrifugo.rs` - Custom WebSocket commands

## Building

Expand Down Expand Up @@ -97,20 +100,6 @@ const errorMessage = computed(() => viewModel.error_message)
5. Effects are processed (HTTP requests, render updates, etc.)
6. ViewModel is updated and Vue re-renders

## Capabilities

### Render

Updates the ViewModel to trigger UI re-rendering.

### HTTP

Makes REST API calls to the backend. The shell handles the actual HTTP request and sends the response back to the core.

### Centrifugo

Manages WebSocket subscriptions for real-time updates. The shell handles the actual WebSocket connection.

## Testing

The core includes unit tests for business logic:
Expand All @@ -129,12 +118,8 @@ cargo clippy -p omnect-ui-core -- -D warnings

**Additional Tasks:**

- [ ] Add comprehensive integration tests for all migrated components
- [ ] Add more unit tests for Core edge cases
- [ ] Performance testing and bundle size optimization
- [ ] Performance bundle size optimization

### Technical Debt

- [ ] Remove deprecated capabilities once crux_core provides alternative Effect generation mechanism
- [ ] Refactor `Model.auth_token` to not be serialized to the view model directly. The current approach of removing `#[serde(skip_serializing)]` in `src/app/src/model.rs` is a workaround for `shared_types` deserialization misalignment. A long-term solution should involve either making TypeGen respect `skip_serializing` or separating view-specific model fields.
- [ ] Address `crux_http` error handling for non-2xx HTTP responses: The current implementation uses a workaround (`x-original-status` header in `useCore.ts` and corresponding logic in macros) because `crux_http` (v0.15) appears to discard response bodies for 4xx/5xx status codes, preventing detailed error messages from reaching the Core. This workaround should be removed if future `crux_http` versions provide a more direct way to access error response bodies.
Loading
Loading