Skip to content

feat(environment): switch to a custom backend from the welcome screen - #324

Merged
DennisBauer merged 3 commits into
mainfrom
feat/environment-switcher
Aug 1, 2026
Merged

feat(environment): switch to a custom backend from the welcome screen#324
DennisBauer merged 3 commits into
mainfrom
feat/environment-switcher

Conversation

@DennisBauer

Copy link
Copy Markdown
Contributor

No description provided.

Base URL and api-key were compiled in as BuildKonfig constants, read once
when the HttpClient and the websocket transport were built. They now come
from an EnvironmentRepository, read per request, so the backend can be
repointed without rebuilding either.

Behaviour is unchanged: the repository only ever serves the build-time
environment. The websocket base is derived from the http one rather than
carried separately, since the two always addressed the same host.

Shared fakes live in a new :core:testing module, laid out like the
per-feature testing modules.
A settings entry beside the welcome actions takes a URL and an api-key,
probes them, and repoints the app on success. A failed probe changes
nothing; the message is shown under the field it blames.

Committing a switch drops everything the previous backend owned: session,
groups, queued writes, and the cached currencies and rates, which the next
server has its own version of. Reachable only while signed out, so there
is no live socket or in-flight sync to tear down.

Web is excluded: its CSP pins connect-src to one API origin at deploy
time, so a stored override could only produce blocked requests.
Nothing reads it since the websocket base became a derivation of
BASE_URL_HTTP. Removing it takes the _ANDROID and _WEB overrides with it,
so a local or deployed build can no longer point http and ws at different
hosts by forgetting one of them.

The web deploy derives its CSP ws origin the same way instead of from a
second secret.
@DennisBauer DennisBauer added the feature New feature or request label Aug 1, 2026
@DennisBauer
DennisBauer merged commit 8335d4d into main Aug 1, 2026
3 checks passed
@DennisBauer
DennisBauer deleted the feat/environment-switcher branch August 1, 2026 11:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant