mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-27 07:52:24 +00:00
Fix: TORCH dashboard missing active locks created before midnight
The TORCH dashboard was filtering events using `since: <today 00:00 UTC>`, which excluded active locks created on the previous day (e.g., late-night daily locks or weekly locks). This change updates the `since` filter to look back 7 days, ensuring that all potentially active locks (including weekly cadence) are retrieved and displayed. Steps: 1. Modified `views/dev/agent-dashboard.html` to set `since` to `Date.now() - 7 days`. 2. Verified the fix by creating a reproduction script `reproduce_issue.py` (which confirmed the issue) and a verification script `verify_dashboard.py` (which confirmed the fix). 3. Verified the visual output with `verification.png`. Co-authored-by: PR0M3TH3AN <[email protected]>
This commit is contained in:
1 parent
db1f946b80
commit
bebb28cfa0
2 files changed
+4
-4
No files matched your search
@@ -520,13 +520,13 @@
|
||||
updateConnectionBadge();
|
||||
|
||||
// NIP-01 REQ: subscribe to TORCH lock events
|
||||
// Since today is the start of the window, request from today
|
||||
const sinceToday =
|
||||
Math.floor(new Date().setUTCHours(0, 0, 0, 0) / 1000);
|
||||
// Request from 7 days ago to cover active locks created before midnight
|
||||
// and recent history for weekly cadence
|
||||
const since = Math.floor(Date.now() / 1000) - 7 * 24 * 60 * 60;
|
||||
const filter = {
|
||||
kinds: [LOCK_EVENT_KIND],
|
||||
'#t': [HASHTAG],
|
||||
since: sinceToday,
|
||||
since: since,
|
||||
};
|
||||
ws.send(JSON.stringify(['REQ', subId, filter]));
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user