carp-dk / carp-dk/carp_study_app

fix(offline): initialize the CAWS backend reactively when connectivity returns

Open
#630 0 comments 0 reactions 1 assignee Claimed by @Zeroupper View on GitHub
Dominant language
Dart
Stars
10
Forks
5
Avg merge
1d 3h
Merged PRs (30d)
14

Description

## Problem
(verified) `initialize()` runs `backend.initialize()` only if a one-shot connectivity check passes (`lib/blocs/app_bloc.dart:181-184`) — offline at launch means auth/services are never configured for the whole session, with no retry and no user feedback. `checkConnectivity()` is point-in-time only (`app_bloc.dart:198-206`).

## Proposed fix
Subscribe to `Connectivity().onConnectivityChanged` in the SystemInfoService from #589; on first regain, complete backend initialization and notify; surface an offline banner state for the router/login page instead of silently dead buttons (`login_page.dart:82` already checks connectivity per-tap, which can then simplify).

## Acceptance criteria
- [ ] Launch offline → go online → login works without app restart (manual + widget test with a mocked connectivity stream)
- [ ] Subscription cancelled on dispose (ties to the leaks EPIC)

**Effort:** M · **Priority:** P1 · **Change risk:** Low-medium

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.