Skip to content

Release/Installer api fixes#54

Merged
aligneddev merged 3 commits into
mainfrom
releaseApi
Jun 15, 2026
Merged

Release/Installer api fixes#54
aligneddev merged 3 commits into
mainfrom
releaseApi

Conversation

@aligneddev

Copy link
Copy Markdown
Owner

No description provided.

aligneddev and others added 3 commits June 15, 2026 13:24
All 8 service files used a module-level VITE_API_BASE_URL constant
(build-time). In the installed Tauri app that env var is undefined, so
every fetch fell back to http://localhost:5436 where no API runs.

Tauri lib.rs already injected window.__BIKE_API_URL__ via window.eval()
but nothing read it.

Changes:
- Add api-config.ts with lazy getApiBaseUrl() that checks
  window.__BIKE_API_URL__ first, then VITE_API_BASE_URL, then 5436
- Update all 8 service files to call getApiBaseUrl() per request
  (lazy evaluation also avoids any eval() timing races)
- Widen CSP from localhost:5079 to localhost:* so any configured
  API port works

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
getByText(/total expenses/i) and getByText(/oil change savings/i)
matched both the label <span> and its parent <div> row, causing
'multiple elements found' errors.

Add { selector: 'span' } to target only the label spans.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
api-config.test.ts — 6 Vitest unit tests verifying:
- window.__BIKE_API_URL__ wins over VITE_API_BASE_URL (Tauri injection)
- trailing slash stripped
- falls back to VITE_API_BASE_URL when Tauri not present
- falls back to localhost:5436 as hard default
- supports custom host from app.conf.json

release.yml — new smoke-test-api job (parallel with package-*):
- dotnet publish API self-contained
- start on localhost:5436
- poll /health up to 30s
- fail release if API doesn't start

publish-release now requires smoke-test-api to pass.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@aligneddev aligneddev merged commit 578929e into main Jun 15, 2026
7 checks passed
@aligneddev aligneddev deleted the releaseApi branch June 15, 2026 14:18
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