Skip to content

Commit 3357144

Browse files
committed
Revert "feat(shopinbit): backfill remote tickets into the local db on refresh"
This reverts commit 91dc822.
1 parent d0a3ee9 commit 3357144

1 file changed

Lines changed: 1 addition & 16 deletions

File tree

lib/services/shopinbit/shopinbit_orders_service.dart

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -158,27 +158,12 @@ class ShopInBitOrdersService extends ChangeNotifier {
158158
Future<void> refreshAll() async {
159159
try {
160160
final customerKey = await shopInBitService.ensureCustomerKey();
161-
final db = SharedDrift.get();
162-
163-
// Backfill rows for tickets that exist on the API but not locally
164-
// (created on another device, web dashboard, etc.). A failure here
165-
// shouldn't stop the refresh of tickets we already know about.
166-
try {
167-
final newCompanions = await shopInBitService.fetchAllForCustomerKey(
168-
customerKey,
169-
);
170-
for (final companion in newCompanions) {
171-
await db.into(db.shopInBitTickets).insertOnConflictUpdate(companion);
172-
}
173-
} catch (_) {
174-
// Fall through to the refresh-existing path.
175-
}
176-
177161
final resp = await shopInBitService.client.getTicketsByCustomer(
178162
customerKey,
179163
);
180164
if (resp.hasError || resp.value == null) return;
181165

166+
final db = SharedDrift.get();
182167
final localRows = await db.select(db.shopInBitTickets).get();
183168
final byApiId = {for (final r in localRows) r.apiTicketId: r};
184169

0 commit comments

Comments
 (0)