Skip to content

mobile: fixes from 5-agent review - #2

Merged
Current-cmd merged 1 commit into
mainfrom
fix/mobile-review
Nov 22, 2026
Merged

Current-cmd merged 1 commit into
mainfrom
fix/mobile-review

Conversation

@Current-cmd

Copy link
Copy Markdown
Owner

What

Fixes the confirmed findings from a 5-agent review of the mobile app (API contracts, upload queue, Android/Expo Go runtime, site UX, security).

Why

The review found a crash on the Heute tab, ways for the upload queue to hang or never resend, a "Freigeben" button that saved nothing, and recording that did not work offline, the main use case on site.

Changes

  • Queue (mobile/src/queue.ts)
    • 15 min XHR timeout, so a dead connection no longer hangs the queue
    • Auto-retry on app start, when the app returns to the foreground, and every 30 s while offline
    • Recovered or failed jobs ask GET /captures/{id} before re-posting, so a run still in flight is not overwritten
    • Every unfinished job is kept; only finished jobs are pruned, with their files
    • Progress ticks no longer rewrite storage
    • Pipeline steps never move backwards when the server replays old events
    • No removal while uploading; each job keeps the token it was recorded with
  • API client (mobile/src/api.ts): websocket reconnect timer cleared on close; spi and forecast_finish typed as nullable
  • Heute
    • No crash when kpi.spi is null
    • Reached states are shown but cannot be tapped
    • KPI labels spelled out (Termintreue, Arbeitstage)
    • Safe-area bottom padding on the state sheet; accessibility labels
  • Erfassen
    • Offline recording with zones cached from the last connection; an alert links to Einstellungen
    • try/catch around camera, microphone and send
    • "Senden an " button and a not-yet-sent banner
    • Voice notes sent as audio/mp4; duration read before stop
  • Bericht: removed the fake "Freigeben"; "Als PDF öffnen" is the main action, with a note that the Bauleitung releases the report in the dashboard
  • Scan: ids are encoded in URLs
  • Einstellungen: a QR code is handled once and the user confirms the server before switching
  • App: a failing report or overview no longer marks the app offline; Android back button; toast announced to screen readers
  • UI: 44 pt default and icon buttons; darker success and info badge text

Testing

  • npx tsc --noEmit passes
  • Web build, offline:
    • Cached zones and the offline alert show
    • A note sent while offline is saved
    • After restart, the app asks the server first (404), re-posts, and the job finishes (mock server)
  • Web build against Hörsaal: the state sheet shows reached states disabled
  • The Android bundle with the fixes builds and is served by the laptop Metro
  • Not tested on a physical phone

Not in this PR (pilot)

  • Token in expo-secure-store
  • HTTPS (tailscale serve)
  • Tailnet IP out of the repo
  • Server-side report release endpoint

- queue: 15 min XHR timeout, auto-retry on reconnect/app start/every 30 s, ask the server before resending a recovered job, keep all unfinished jobs, no storage writes per progress tick, steps never move backwards on event replay, no removal while uploading, per-job token
- api: websocket reconnect timer cleared on close, spi/forecast may be null
- Today: no crash when SPI is null, reached states not tappable, spelled-out KPI labels, safe-area bottom padding, accessibility labels
- Capture: works offline with cached zones (alert links to settings), try/catch around camera/mic/send, 'Senden an <Zone>', not-yet-sent banner, audio/mp4, duration read before stop
- Report: removed the fake Freigeben button, PDF is the main action; Scan: encoded ids in URLs
- Settings: QR scan handled once and confirmed before switching server
- App: report/overview failures no longer mark the app offline, Android back button, toast live region
- UI: 44 pt default and icon buttons, darker success/info badge text
@Current-cmd
Current-cmd merged commit 3e271d7 into main Nov 22, 2026
2 checks passed
@Current-cmd
Current-cmd deleted the fix/mobile-review branch November 22, 2026 02:06
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