sib: (delivery) state parsing fix and loading message changed
What changed, and why it matters
This commit fixes a small parsing bug in the Stack Wallet app's ShopInBit feature. The app reads a 'state/province' line from a support ticket message. Previously it only looked for lines starting with 'Delivery state:', but now it also accepts 'State:'. A user-facing loading message was also reworded from 'Updating available countries' to 'Checking available countries'. There is no clear security relevance in the change itself.
No security action required. Treat as routine UI/UX and parsing fix. If the state value is later used in address formatting or API calls, ensure downstream consumers handle unexpected values safely.
Security signals we found
Input parsing logic changed, but in a more permissive direction
No validation, sanitization, or authorization changes observed
No cryptographic, network, or secret-handling code modified
Evidence from the diff
In lib/pages/shopinbit/shopinbit_shipping_view.dart, the code that extracts a state/province from a ticket message now matches both ‘Delivery state:’ and ‘State:’ prefixes. If neither is found, it logs a fatal error and throws ArgumentError. The change broadens accepted input formats, likely to handle messages where the field is labeled differently. The offer view change is purely cosmetic text in a loading dialog.
Changed components
lib/pages/shopinbit/shopinbit_shipping_view.dartlib/pages/shopinbit/shopinbit_offer_view.dartInspect captured patch +5 / −3
diff --git a/lib/pages/shopinbit/shopinbit_offer_view.dart b/lib/pages/shopinbit/shopinbit_offer_view.dart
index b170407..9232821 100644
--- a/lib/pages/shopinbit/shopinbit_offer_view.dart
+++ b/lib/pages/shopinbit/shopinbit_offer_view.dart
@@ -114,7 +114,7 @@ class ShopInBitOfferView extends ConsumerWidget {
final response = await showLoading(
context: context,
rootNavigator: true,
- message: "Updating available countries",
+ message: "Checking available countries",
whileFuture: shopinBitApi.getCountries(),
delay: const Duration(
seconds: 1,
diff --git a/lib/pages/shopinbit/shopinbit_shipping_view.dart b/lib/pages/shopinbit/shopinbit_shipping_view.dart
index c29aa9d..9dee2da 100644
--- a/lib/pages/shopinbit/shopinbit_shipping_view.dart
+++ b/lib/pages/shopinbit/shopinbit_shipping_view.dart
@@ -139,10 +139,12 @@ class _ShopInBitShippingViewState extends ConsumerState<ShopInBitShippingView> {
}
final line = parts
- .where((e) => e.startsWith("Delivery state:"))
+ .where(
+ (e) => e.startsWith("Delivery state:") || e.startsWith("State:"),
+ )
.firstOrNull;
if (line == null) {
- Logging.instance.f("Missing delivery state/province in first message!");
+ Logging.instance.f("Missing state/province in first message!");
throw ArgumentError("Missing state/province in first ticket message");
}
Why this scored 18/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.