Fixed ghost channel subscription
This commit is contained in:
@@ -256,7 +256,7 @@ final ticketsProvider = StreamProvider<List<Ticket>>((ref) {
|
||||
// ── Realtime stream ───────────────────────────────────────────────────────
|
||||
// Processes every realtime event through the same isolate. Debounced so
|
||||
// rapid consecutive events (e.g. bulk inserts) don't cause repeated renders.
|
||||
wrapper.stream
|
||||
final wrapperSub = wrapper.stream
|
||||
.asyncMap((result) async {
|
||||
final payload = _buildTicketPayload(
|
||||
tickets: result.data,
|
||||
@@ -280,10 +280,12 @@ final ticketsProvider = StreamProvider<List<Ticket>>((ref) {
|
||||
},
|
||||
onError: (Object e) {
|
||||
debugPrint('[ticketsProvider] stream error: $e');
|
||||
controller.addError(e);
|
||||
// Don't forward errors — the wrapper handles recovery internally.
|
||||
},
|
||||
);
|
||||
|
||||
ref.onDispose(wrapperSub.cancel);
|
||||
|
||||
return controller.stream;
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user