Fix 5 bugs: analytics range keys, stale visitor rows, NuggetsPage init state, episodes timer leak, unsanitized nuggets object; v2.0.1
Publish Container / docker (push) Successful in 14m54s
Publish Container / docker (push) Successful in 14m54s
- analytics: union byDayReal+byDayBot keys so bot-only days aren't dropped from range totals - analytics: exclude timestamp-less visitor rows from range filters (was unconditionally including them) - App.tsx: init `configured` to false so a network failure doesn't show a misleading "no episodes" state; add r.ok guard before r.json() - episodes.js: wrap fetch in try/catch so clearTimeout is called on network failure, matching the nuggets.js pattern - helpers.js: add sanitizeNuggets + wire it into sanitizeSiteContent so corrupted hosts/urls can't crash NuggetsPage Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
31e79ad542
commit
4378fad66f
5 files changed
+50
-14
No files matched your search
@@ -213,7 +213,11 @@ export function register(app) {
|
||||
})()
|
||||
|
||||
// Filter byDayReal/byDayBot keys to only those within the range
|
||||
const filteredDayKeys = Object.keys(state.hitStats.byDayReal ?? {}).filter(day => day >= cutoffDate)
|
||||
const allDayKeys = new Set([
|
||||
...Object.keys(state.hitStats.byDayReal ?? {}),
|
||||
...Object.keys(state.hitStats.byDayBot ?? {}),
|
||||
])
|
||||
const filteredDayKeys = [...allDayKeys].filter(day => day >= cutoffDate)
|
||||
|
||||
// Aggregate hits for the range
|
||||
const rangeRealHits = filteredDayKeys.reduce((sum, day) => sum + (state.hitStats.byDayReal?.[day] ?? 0), 0)
|
||||
@@ -222,7 +226,7 @@ export function register(app) {
|
||||
|
||||
// Filter per-path stats by range — approximate using recent visitor rows scoped to range
|
||||
const rangeVisitorRows = state.visitorStats.recentVisits.filter(row => {
|
||||
if (!row.at) return true // include if no timestamp
|
||||
if (!row.at) return false // exclude rows with no timestamp from range views
|
||||
return row.at >= cutoffDate
|
||||
})
|
||||
|
||||
|
||||
Reference in new issue
Block a user