Notechondria
Version: 0.1.44 Build Date: 2026-04-19T15:00
What's Changed
Fix: login prompt showed stale/default backend URL, not the configured one
The login dialog, the learner header, the front-page URL badge, and
a handful of other UI surfaces were reading
_httpClient?.baseUrl to decide which backend URL to display. That
reads from the HTTP client's in-memory _baseUrl field, which
diverges from the user's saved setting in two scenarios:
- Boot race.
HttpNotechondriaClient()is constructed inMyApp.build()withoutinitialBaseUrl, so it starts life pointing at_defaultApiBaseUrl()(http://localhost:9080/api/v1on native,/api/v1on web)._loadLocalState()later calls_httpClient.updateBaseUrl(_localSettings['api_base_url']), but any UI drawn before that async load settles reads the default. - Post-save rebuild gap.
ApiClient.updateBaseUrlmutates_baseUrlin place without notifying listeners, and_applyLocalAppSettingsdoesn'tsetState. If the next frame doesn't rebuild the header/dialog, it keeps showing the pre-save baseUrl.
Fix: switch the eight apiBaseUrl: _httpClient?.baseUrl call sites
to _localSettings['api_base_url']?.toString() ?? _httpClient?.baseUrl.
_localSettings is the source of truth — it's loaded synchronously
into state during _loadLocalState before the first paint it
influences, and _applyLocalAppSettings rewrites it before the
updateBaseUrl call, so it's never less fresh than the HTTP
client's view. The _httpClient?.baseUrl fallback preserves
behaviour during the brief window before _loadLocalState
completes.
The save pipeline itself (via _LocalAppStore.saveSettings to the
notechondria.local_settings shared_preferences key) was always
correct — this is purely a display bug on the read side.
Files Changed
New
docs/versions/0.1.44.md(this file).
Modified
VERSION: 0.1.43 → 0.1.44.- frontend/editor_app/lib/app_shell.dart:
two
apiBaseUrl:call sites (learner header, settings page). - frontend/planner_app/lib/app_shell.dart:
three
apiBaseUrl:call sites (learner header, planner header, settings page). - frontend/portal_app/lib/app_shell.dart:
four
apiBaseUrl:call sites (front page, learner header, browser header, settings page).
Verification
editor_app/planner_app/portal_app:flutter analyzeissue counts unchanged vs 0.1.43 (54 / 70 / 68); no errors.flutter test test/smoke_test.dartpasses on all three.
Notes / follow-ups
- A deeper fix would make
ApiClientextendChangeNotifier(or expose aValueListenable<String>forbaseUrl) soupdateBaseUrlnotifies subscribers automatically. That would also let us remove the manual_localSettings-vs-baseUrlpriority and let the HTTP client be the single source of truth. Deferred to avoid a wider API-client refactor for a one-line display bug. - The normalization asymmetry (user types
http://host:8000, client storeshttp://host:8000/api/v1) is still present but is now hidden from the user:_apiHostSubtitleinnotechondria_shared/lib/src/components/auth_dialogs.dartparses out just the authority for display, so the trailing/api/v1is never shown. No change needed there this round.