Skip to content

Commit f11cdaa

Browse files
authored
Merge pull request #149 from tacticalnoot/codex/investigate-data-loading-issues-and-cache-behavior
2 parents a78c06b + 0c2c033 commit f11cdaa

2 files changed

Lines changed: 6 additions & 14 deletions

File tree

src/services/api/smols.ts

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -54,19 +54,9 @@ export async function fetchSmols(options?: { limit?: number; signal?: AbortSigna
5454
};
5555
});
5656

57-
// 3. Add songs from snapshot that aren't in the live response
58-
const liveIds = new Set(liveSmols.map((s) => s.Id));
59-
snapshot.forEach((oldSmol) => {
60-
if (!liveIds.has(oldSmol.Id)) {
61-
merged.push({
62-
...oldSmol,
63-
Tags: oldSmol.Tags || [],
64-
Address: oldSmol.Address || undefined,
65-
Minted_By: oldSmol.Minted_By || undefined,
66-
Username: oldSmol.Username || undefined,
67-
});
68-
}
69-
});
57+
// 3. Do NOT append snapshot-only songs when live API succeeded.
58+
// Live must remain authoritative for "latest" ordering and corpus freshness.
59+
// Snapshot is only a field-level fallback for known live IDs.
7060

7161
// 4. DEEP VERIFICATION: Hydrate missing metadata for "Live-Only" songs
7262
// (Songs present in API but not in snapshot = New drops missing tags/address)

src/services/api/snapshot.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ export async function getSnapshotAsync(): Promise<Smol[]> {
1212
if (cachedSnapshot) return cachedSnapshot;
1313

1414
try {
15-
const res = await fetch('/data/GalacticSnapshot.json');
15+
const res = await fetch('/data/GalacticSnapshot.json', {
16+
cache: 'no-store',
17+
});
1618
if (!res.ok) throw new Error(`Snapshot load failed: ${res.status}`);
1719
const data = await res.json();
1820

0 commit comments

Comments
 (0)