Skip to content

Improve API error handling and user recovery - #376

Merged
jakobkoerber merged 11 commits into
mainfrom
codex/improve-api-error-handling
Nov 8, 2026
Merged

jakobkoerber merged 11 commits into
mainfrom
codex/improve-api-error-handling

Conversation

@jakobkoerber

@jakobkoerber jakobkoerber commented Nov 7, 2026 •

Copy link
Copy Markdown
Member

Issue

Several API-to-UI paths lose the original failure, discard its source stack, leave dependent streams loading, or report a mutation as complete before its request finishes. Some cards also replace real failures with a generic Error, and the custom gRPC cache bridge can leave rejected calls unresolved.

Why this is useful for all students

Users see localized, actionable error messages while the original exception and source stack remain available for diagnosis. Shared Campus collection views and floating snackbars retain the same error metadata and recovery policy. Recoverable reads offer Retry, invalid TUMonline tokens retain Login, and ambiguous submissions advise checking the outcome before submitting again. Large-text explanations wrap and scroll.

  • Preserve original errors and source stacks across data streams and screens, including all search categories, both News streams, profile/tuition, student cards, studies, and place cards. TU Film and Student Clubs no longer create placeholder errors. News previews no longer mutate full-screen data.
  • Distinguish server failures, unsupported features, gateway problems, temporary service unavailability and service timeouts. Recognize the gRPC fork's exact generated HTTP-404 transport message separately from genuine domain NOT_FOUND responses.
  • Preserve TUMonline domain errors on non-2xx replies, retain configured Dio settings during refresh, and restrict stale-cache fallback. Evict corrupt REST fallback data without hiding programming failures. The gRPC cache adapter propagates rejection and cancellation and retains successful network metadata.
  • Preserve cafeteria menu failures instead of returning errors as data, propagate cancellation, and settle empty cafeteria/study-room responses as empty states. Saved study-room groups that disappear no longer throw. Delayed loaders cancel their timers when removed.
  • Await calendar deletion, show original mutation failures without closing the creation form, and keep native export failures separate from a successfully fetched timetable. Preserve plugin failure results and causes; failed cleanup retains mappings for retry.
  • Show actual profile and tuition failures with recovery actions. Optional artwork uses placeholders, including failed SVG club covers. Unexpected failures are sanitized, nonfatal reports outside widget builds.

Unverified TUMonline error strings retain the generic fallback. EFA-specific error envelopes still require verified fixtures. Read-only production probes returned HTTP 404 for News and movies; correcting client error handling does not repair that service/deployment issue.

Release target

Target version: 5.4.1 (5.4.1+1 is already set in pubspec). The latest published release is v5.4.0. This is a compatibility-preserving bug-fix release; no release tag or store publication is created by this PR.

Refresh 12 compatible direct/transitive packages, including SQLite 3.9.1, Flutter Riverpod 3.5.0, and GoRouter 18.1.3. Retain the current Flutter/Dart baseline and dependency overrides. Packages requiring incompatible constraint changes remain outside this patch release. A fresh SQLite 3.9.1 macOS native download passes its checksum verification locally.

Screenshot

No screenshots attached. Widget tests exercise every card error path, recovery actions, empty states, large text, short layouts, and calendar submission failures.

Validation

  • flutter test --no-pub: 380 tests passed in the main checkout after merging current main.
  • flutter analyze --no-pub: no issues found.
  • git diff --check: passed.
  • Regression tests verify original exception identity and source stacks, all search categories, REST/gRPC fallback and cancellation, corrupt cache data, partial calendar exports, retained cleanup mappings, and card empty/error states.

The audit remains excluded. The resolved merge preserves current main’s Campus UI, floating snackbars, login announcements, and location-permission onboarding. No live authenticated or mutation API calls were used for validation.

@jakobkoerber
jakobkoerber marked this pull request as ready for review November 7, 2026 21:40
@jakobkoerber
jakobkoerber merged commit bcf656a into main Nov 8, 2026
3 checks passed
@jakobkoerber
jakobkoerber deleted the codex/improve-api-error-handling branch November 8, 2026 20:04
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