Comfy-Org / Comfy-Org/download-data
Bug: First observation of an asset inflates daily delta (re-uploads/new IDs)
- Dominant language
- TypeScript
- Stars
- 4
- Forks
- 4
- PR merge metrics
- No merged PRs in 30d
Description
Summary
Daily summary treats missing prior snapshot as if today’s full download_count is the delta, which can spike totals when an asset is first seen (including re-uploads with a new asset_id).
Evidence
- CASE expression: scripts/fetch-data.mjs:346–357 (and similar) uses
WHEN old.download_count IS NULL THEN new.download_count
Proposed Fix
- Treat first observation as 0 delta:
CASE WHEN old.download_count IS NULL THEN 0 ELSE new.download_count - old.download_count END
- Alternatively detect first_seen date per asset_id (MIN(date)) and force 0 when new.date == first_seen.
Acceptance Criteria
- Newly appearing assets no longer cause one-day spikes
- Subsequent days reflect true diffs
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.