What changed, and why it matters
This is a small bug-fix patch in a mobile wallet's shopping-support ticket screen. It stores a service reference when the screen first loads, then reuses that reference later, instead of asking the app's state-management system for the service again after the screen may have been destroyed. The change prevents a runtime crash ('provider read after dispose') but does not appear to be a security vulnerability.
Treat as a routine stability fix. No security response required. If reviewing further, verify that the cached service does not outlive any underlying authentication tokens or session state, and that dispose() cancels the polling timer and message controller as expected.
Security signals we found
No security-relevant keywords in commit title or message
Diff is a null-safety/lifecycle fix, not an authorization, cryptography, or input-validation change
No explicit vendor security disclosure or advisory supplied
No CVE or researcher attribution present in commit
Evidence from the diff
In lib/pages/shopinbit/shopinbit_ticket_detail.dart the widget now reads the pShopinBitService provider once in initState() and caches it in _shopinBitService. The _refresh() method then uses the cached reference rather than calling ref.read(pShopinBitService) again. This avoids a ProviderException when the widget’s Ref is accessed after the widget has been disposed. The patch is defensive and local; there is no evidence of exploitable memory corruption, privilege escalation, or data leakage.
Changed components
lib/pages/shopinbit/shopinbit_ticket_detail.dartShopInBit ticket detail screenpShopinBitService provider access patternInspect captured patch +5 / −1
diff --git a/lib/pages/shopinbit/shopinbit_ticket_detail.dart b/lib/pages/shopinbit/shopinbit_ticket_detail.dart
index f4a7190..0057f36 100644
--- a/lib/pages/shopinbit/shopinbit_ticket_detail.dart
+++ b/lib/pages/shopinbit/shopinbit_ticket_detail.dart
@@ -11,6 +11,7 @@ import '../../models/shopinbit/shopinbit_enums.dart';
import '../../notifications/show_flush_bar.dart';
import '../../providers/db/drift_provider.dart';
import '../../providers/global/shopin_bit_service_provider.dart';
+import '../../services/shopinbit/shopinbit_service.dart';
import '../../services/shopinbit/src/api_response.dart';
import '../../services/shopinbit/src/client.dart';
import '../../services/shopinbit/src/models/message.dart';
@@ -50,6 +51,7 @@ class ShopInBitTicketDetail extends ConsumerStatefulWidget {
class _ShopInBitTicketDetailState extends ConsumerState<ShopInBitTicketDetail>
with WidgetsBindingObserver {
late final TextEditingController _messageController;
+ late final ShopInBitService _shopinBitService;
static const Duration _kBasePollInterval = Duration(seconds: 30);
static const Duration _kMaxPollInterval = Duration(seconds: 120);
@@ -77,6 +79,8 @@ class _ShopInBitTicketDetailState extends ConsumerState<ShopInBitTicketDetail>
void initState() {
super.initState();
+ _shopinBitService = ref.read(pShopinBitService);
+
_messageController = TextEditingController();
WidgetsBinding.instance.addObserver(this);
@@ -148,7 +152,7 @@ class _ShopInBitTicketDetailState extends ConsumerState<ShopInBitTicketDetail>
unawaited(_poll());
}
- Future<void> _refresh() => ref.read(pShopinBitService).refreshOne(_id);
+ Future<void> _refresh() => _shopinBitService.refreshOne(_id);
Future<void> _sendMessage() async {
final text = _messageController.text.trim();
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.