experiments in a post-browser web
10
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix(test): remove syncSource references from e2e test SQL

syncSource column was removed from desktop/server schemas as part of
the sync refactor. Desktop/server INSERTs and queries now use syncId
instead. iOS sync_source (snake_case) is unchanged — iOS schema still
has that column.

+22 -22
+22 -22
scripts/e2e-full-sync-test.sh
··· 311 311 # Desktop schema: content (no url column), camelCase columns, integer timestamps 312 312 DESKTOP_DB="$DESKTOP_PROFILE_DIR/datastore.sqlite" 313 313 sqlite3 "$DESKTOP_DB" << 'SQLEOF' 314 - INSERT INTO items (id, type, content, metadata, syncId, syncSource, syncedAt, createdAt, updatedAt, deletedAt) 314 + INSERT INTO items (id, type, content, metadata, syncId, syncedAt, createdAt, updatedAt, deletedAt) 315 315 VALUES 316 316 (lower(hex(randomblob(4)) || '-' || hex(randomblob(2)) || '-' || hex(randomblob(2)) || '-' || hex(randomblob(2)) || '-' || hex(randomblob(6))), 317 - 'url', 'https://example.com/desktop-origin-1', '{}', '', '', 0, 317 + 'url', 'https://example.com/desktop-origin-1', '{}', '', 0, 318 318 strftime('%s','now') * 1000, strftime('%s','now') * 1000, 0), 319 319 (lower(hex(randomblob(4)) || '-' || hex(randomblob(2)) || '-' || hex(randomblob(2)) || '-' || hex(randomblob(2)) || '-' || hex(randomblob(6))), 320 - 'text', 'Note created on desktop', '{}', '', '', 0, 320 + 'text', 'Note created on desktop', '{}', '', 0, 321 321 strftime('%s','now') * 1000, strftime('%s','now') * 1000, 0); 322 322 SQLEOF 323 323 ··· 340 340 SQLEOF 341 341 342 342 DESKTOP_TOTAL=$(sqlite3 "$DESKTOP_DB" "SELECT COUNT(*) FROM items WHERE deletedAt = 0;") 343 - DESKTOP_LOCAL=$(sqlite3 "$DESKTOP_DB" "SELECT COUNT(*) FROM items WHERE deletedAt = 0 AND syncSource = '';") 343 + DESKTOP_LOCAL=$(sqlite3 "$DESKTOP_DB" "SELECT COUNT(*) FROM items WHERE deletedAt = 0 AND syncId = '';") 344 344 echo " Desktop total items: $DESKTOP_TOTAL ($DESKTOP_LOCAL local-only, rest from server pull)" 345 345 346 346 # Push desktop-origin items to server via full sync ··· 740 740 741 741 CROSS_URL="https://example.com/cross-device-url" 742 742 743 - # Seed into desktop SQLite (no syncId, no syncSource — appears as local-only) 743 + # Seed into desktop SQLite (no syncId — appears as local-only) 744 744 sqlite3 "$DESKTOP_DB" << SQLEOF 745 - INSERT INTO items (id, type, content, metadata, syncId, syncSource, syncedAt, createdAt, updatedAt, deletedAt) 745 + INSERT INTO items (id, type, content, metadata, syncId, syncedAt, createdAt, updatedAt, deletedAt) 746 746 VALUES 747 747 (lower(hex(randomblob(4)) || '-' || hex(randomblob(2)) || '-' || hex(randomblob(2)) || '-' || hex(randomblob(2)) || '-' || hex(randomblob(6))), 748 - 'url', '$CROSS_URL', '{}', '', '', 0, 748 + 'url', '$CROSS_URL', '{}', '', 0, 749 749 strftime('%s','now') * 1000, strftime('%s','now') * 1000, 0); 750 750 SQLEOF 751 751 ··· 754 754 INSERT OR IGNORE INTO tags (id, name, slug, createdAt) VALUES ('tag-crossdev', 'cross-device', 'cross-device', strftime('%s','now') * 1000); 755 755 INSERT INTO item_tags (id, itemId, tagId, createdAt) 756 756 SELECT 'it-' || hex(randomblob(8)), id, 'tag-crossdev', strftime('%s','now') * 1000 757 - FROM items WHERE content = 'https://example.com/cross-device-url' AND syncSource = ''; 757 + FROM items WHERE content = 'https://example.com/cross-device-url' AND syncId = ''; 758 758 SQLEOF 759 759 760 760 echo " Seeded cross-device URL into desktop" ··· 781 781 782 782 # Seed into desktop SQLite 783 783 sqlite3 "$DESKTOP_DB" << 'SQLEOF' 784 - INSERT INTO items (id, type, content, metadata, syncId, syncSource, syncedAt, createdAt, updatedAt, deletedAt) 784 + INSERT INTO items (id, type, content, metadata, syncId, syncedAt, createdAt, updatedAt, deletedAt) 785 785 VALUES 786 786 (lower(hex(randomblob(4)) || '-' || hex(randomblob(2)) || '-' || hex(randomblob(2)) || '-' || hex(randomblob(2)) || '-' || hex(randomblob(6))), 787 - 'tagset', '', '{}', '', '', 0, 787 + 'tagset', '', '{}', '', 0, 788 788 strftime('%s','now') * 1000, strftime('%s','now') * 1000, 0); 789 789 790 790 INSERT OR IGNORE INTO tags (id, name, slug, createdAt) VALUES ('tag-shared', 'shared', 'shared', strftime('%s','now') * 1000); ··· 792 792 793 793 INSERT INTO item_tags (id, itemId, tagId, createdAt) 794 794 SELECT 'it-' || hex(randomblob(8)), id, 'tag-shared', strftime('%s','now') * 1000 795 - FROM items WHERE type = 'tagset' AND content = '' AND syncSource = '' AND deletedAt = 0 795 + FROM items WHERE type = 'tagset' AND content = '' AND syncId = '' AND deletedAt = 0 796 796 ORDER BY createdAt DESC LIMIT 1; 797 797 798 798 INSERT INTO item_tags (id, itemId, tagId, createdAt) 799 799 SELECT 'it-' || hex(randomblob(8)), id, 'tag-tagset', strftime('%s','now') * 1000 800 - FROM items WHERE type = 'tagset' AND content = '' AND syncSource = '' AND deletedAt = 0 800 + FROM items WHERE type = 'tagset' AND content = '' AND syncId = '' AND deletedAt = 0 801 801 ORDER BY createdAt DESC LIMIT 1; 802 802 SQLEOF 803 803 ··· 1057 1057 1058 1058 # SERVER duplicates (camelCase schema, content column for url+text) 1059 1059 sqlite3 "$SERVER_DB" << 'SQLEOF' 1060 - INSERT INTO items (id, type, content, metadata, syncId, syncSource, syncedAt, createdAt, updatedAt, deletedAt) 1060 + INSERT INTO items (id, type, content, metadata, syncId, syncedAt, createdAt, updatedAt, deletedAt) 1061 1061 VALUES 1062 - ('dup-srv-url-1', 'url', 'https://example.com/server-origin-1', '', '', '', 0, 1000000, 1000000, 0), 1063 - ('dup-srv-text-1', 'text', 'Note created on server', '', '', '', 0, 1000000, 1000000, 0); 1062 + ('dup-srv-url-1', 'url', 'https://example.com/server-origin-1', '', '', 0, 1000000, 1000000, 0), 1063 + ('dup-srv-text-1', 'text', 'Note created on server', '', '', 0, 1000000, 1000000, 0); 1064 1064 1065 1065 -- Duplicate tagset: same tags as cross-device tagset (shared, tagset) 1066 - INSERT INTO items (id, type, content, metadata, syncId, syncSource, syncedAt, createdAt, updatedAt, deletedAt) 1067 - VALUES ('dup-srv-tagset-1', 'tagset', NULL, '', '', '', 0, 1000000, 1000000, 0); 1066 + INSERT INTO items (id, type, content, metadata, syncId, syncedAt, createdAt, updatedAt, deletedAt) 1067 + VALUES ('dup-srv-tagset-1', 'tagset', NULL, '', '', 0, 1000000, 1000000, 0); 1068 1068 1069 1069 INSERT INTO item_tags (itemId, tagId, createdAt) 1070 1070 SELECT 'dup-srv-tagset-1', id, 1000000 FROM tags WHERE name IN ('shared', 'tagset'); ··· 1073 1073 1074 1074 # DESKTOP duplicates (camelCase schema, item_tags has id column) 1075 1075 sqlite3 "$DESKTOP_DB" << 'SQLEOF' 1076 - INSERT INTO items (id, type, content, metadata, syncId, syncSource, syncedAt, createdAt, updatedAt, deletedAt) 1076 + INSERT INTO items (id, type, content, metadata, syncId, syncedAt, createdAt, updatedAt, deletedAt) 1077 1077 VALUES 1078 - ('dup-desk-url-1', 'url', 'https://example.com/desktop-origin-1', '{}', '', '', 0, 1000000, 1000000, 0), 1079 - ('dup-desk-text-1', 'text', 'Note created on desktop', '{}', '', '', 0, 1000000, 1000000, 0); 1078 + ('dup-desk-url-1', 'url', 'https://example.com/desktop-origin-1', '{}', '', 0, 1000000, 1000000, 0), 1079 + ('dup-desk-text-1', 'text', 'Note created on desktop', '{}', '', 0, 1000000, 1000000, 0); 1080 1080 1081 1081 -- Duplicate tagset 1082 - INSERT INTO items (id, type, content, metadata, syncId, syncSource, syncedAt, createdAt, updatedAt, deletedAt) 1083 - VALUES ('dup-desk-tagset-1', 'tagset', '', '{}', '', '', 0, 1000000, 1000000, 0); 1082 + INSERT INTO items (id, type, content, metadata, syncId, syncedAt, createdAt, updatedAt, deletedAt) 1083 + VALUES ('dup-desk-tagset-1', 'tagset', '', '{}', '', 0, 1000000, 1000000, 0); 1084 1084 1085 1085 INSERT INTO item_tags (id, itemId, tagId, createdAt) 1086 1086 SELECT 'it-dup-' || hex(randomblob(4)), 'dup-desk-tagset-1', id, 1000000