fix: paginate getAllSyncedRows to fetch all products beyond the 1000 row Supabase cap

With 1005+ products, the old query returned only the top 1000 by updated_at.
Items edited long ago (like 51016DE) were silently missing from syncedData,
so the merge never applied their saved edits. Now paginate by product_id
until we exhaust the table.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Christian Vidal Wolf
2026-04-23 16:56:54 +02:00
co-authored by Claude Sonnet 4.6
parent be7009353a
commit e1cfaaedfa
2 changed files with 23 additions and 17 deletions
-3
View File
@@ -134,9 +134,6 @@ export default function App() {
console.log('Fetching synced data from Supabase...');
const syncedData = await getAllSyncedRows();
// TEMP DIAG
const d = syncedData['51016DE'];
console.log('[DIAG v2] 51016DE:', d ? `status=${d.status} len=${d.data?.length} [103]=${JSON.stringify(d.data?.[103])}` : 'NOT FOUND');
// Extend headers with virtual columns if the Excel is shorter than the saved data.
// COLUMNS hardcoded indices (PRODUCT_TYPE=103, ITEM_TO_LOGISTIC=104, etc.) are used