Force simulate mode when OSM OAuth secrets are missing

Preview/PR builds don't have access to GitHub Secrets, so the OAuth
client IDs are empty. Previously this caused a runtime crash from
keys.dart throwing on empty values. Now we detect missing secrets
and force simulate mode, which already fully supports fake auth
and uploads.

Also fixes a latent bug where forceLogin() would crash with
LateInitializationError in simulate mode since _helper is never
initialized when OAuth setup is skipped.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Doug Borg
2026-03-07 11:25:17 -07:00
co-authored by Claude Opus 4.6
parent aeb1903bbc
commit 5728b4f70f
5 changed files with 106 additions and 15 deletions
@@ -23,6 +23,8 @@ class UploadModeSection extends StatelessWidget {
subtitle: Text(locService.t('uploadMode.subtitle')),
trailing: DropdownButton<UploadMode>(
value: appState.uploadMode,
// This entire section is gated behind kEnableDevelopmentModes
// in osm_account_screen.dart, so all modes are always available here.
items: [
DropdownMenuItem(
value: UploadMode.production,