From 95a71302559a01317d7e56af652e8f273c0bd2fa Mon Sep 17 00:00:00 2001 From: thePR0M3TH3AN <53631862+PR0M3TH3AN@users.noreply.github.com> Date: Thu, 28 May 2026 22:12:58 -0400 Subject: [PATCH] Fix: premium events were all collapsing into one row via fingerprint dedup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adam reported the "All" filter in the template browser was empty. The root cause: when buildRowsFromEvents synthesises a stub payload for a still-locked premium row (we can't see the encrypted content), the stub has no layers / slots / canvas data — so designFingerprint returns essentially the same string for every premium row of the same template mode. dedupByFingerprint then collapses them all into a single row whose title happens to come from the earliest createdAt event. With a feed full of premium designs and no plain ones, the "All" view looked nearly empty. Fix: designFingerprint short-circuits and returns '' (treated by dedupByFingerprint as "skip dedup, always keep this row") for any payload that has `premium: true` AND no content-bearing fields (layers / coverTemplate / discTemplate / customArt / etc). That matches exactly the stub shape produced by _stubPayloadFromPremiumEvent — once the user unlocks and the cached decrypted payload replaces the stub, the row has its real fields back and normal content-based dedup resumes. Tested via CDP: - 5 premium events from different creators with different d-tags and titles → all 5 rows survive the rerender → all 5 cards visible. Previously this would have been 1 card. - The earlier mixed test (1 plain + 1 premium + 1 legacy) keeps the same 2-card result (plain + legacy DO have matching fingerprints because their plaintext is identical) — exactly what dedup is supposed to do for non-premium events. Co-Authored-By: Claude Opus 4.7 --- src/index.html | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/index.html b/src/index.html index 5539463..a1db5a7 100644 --- a/src/index.html +++ b/src/index.html @@ -20240,6 +20240,18 @@ // Two events with the same fingerprint represent the exact same design. function designFingerprint(payload) { if (!payload) return ''; + // Premium events publish an encrypted envelope, so the fingerprint + // function can't see the real design — every still-locked stub of + // the same templateMode would otherwise hash to the same value and + // dedupByFingerprint would collapse them all into one feed row. + // Treat each premium row as unique (empty fingerprint = "skip dedup" + // in dedupByFingerprint). Once unlocked, payload becomes the real + // decrypted JSON and dedup falls through normally. + if (payload.premium === true && !payload.layers && !payload.slide && !payload.customArt + && !payload.coverTemplate && !payload.discTemplate && !payload.jewelTemplate + && !payload.discDesign && !payload.deck && !payload.pixelArt) { + return ''; + } const mode = normalizeTemplateMode(payload); const j = (v) => JSON.stringify(v ?? null); const fields = [mode];