Skip to content

feat(admin): add bounded NIP-66 probe history and timeline - #814

Open
Ferryx349 wants to merge 3 commits into
mainfrom
feat/admin-network-health-history
Open

Ferryx349 wants to merge 3 commits into
mainfrom
feat/admin-network-health-history

Conversation

@Ferryx349

Copy link
Copy Markdown
Collaborator

Description

  • Persist bounded NIP-66 probe run history and expose GET /admin/network-health/history?limit=
  • Add nip66.historyRetentionRuns (default 168) and optional historyRetentionHours
  • Admin dashboard timeline for recent probe runs

Related Issue

Closes - #800

Motivation and Context

How Has This Been Tested?

  • pnpm run test:unit
  • Enable NIP-66, wait for probe runs, confirm history API and dashboard timeline

Screenshots (if appropriate):

Types of changes

  • Non-functional change (docs, style, minor refactor)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my code changes.
  • I added a changeset, or this is docs-only and I added an empty changeset.
  • All new and existing tests passed.

@changeset-bot

changeset-bot Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 385e919

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
nostream Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@greptile-apps

greptile-apps Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 3/5

[Medium impact] Adds probe history storage and admin API endpoint.

Fix the stale default dashboard view and overlapping history deletion before merging.

Findings

  1. P1 Latest probes stop appearing ▶
  2. P1 Cleanup deletes retained runs ▶

Summary

Adds bounded NIP-66 probe history, an authenticated history API, and a dashboard timeline.

  • Admins can request bounded history for NIP-66 probe runs.
  • The Network Health panel lets admins select earlier probe runs.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  Worker[Probe worker] --> Latest[Latest snapshot]
  Worker --> History[Redis probe history]
  Worker --> Public[Public NIP-66 events]
  History --> Cleanup[Count and age cleanup]
  API[Authenticated history request] --> Cleanup
  Cleanup --> Timeline[Dashboard timeline]
  Latest --> Panel[Dashboard probe panel]
  Timeline --> Panel
Loading

Reviews (2) · Last reviewed commit: "fix(admin): address Greptile review on p..." · Reviewed by Greptile

Comment thread resources/default-settings.yaml
Comment thread src/utils/relay-probe-history.ts Outdated
Comment thread src/app/relay-monitor-worker.ts
Comment thread resources/admin/assets/dashboard.js Outdated
Comment thread src/utils/relay-probe-history.ts Outdated
@coveralls

coveralls commented Oct 11, 2026 •

Copy link
Copy Markdown
Collaborator

Coverage Status

coverage: 74.031% (+0.1%) from 73.911% — feat/admin-network-health-history into main

Register nip66.historyRetentionHours in defaults, trim history on read,
use rank-based Redis cleanup, isolate history failures from NIP-66 publish,
and preserve timeline selection during dashboard polling.
Comment thread resources/admin/assets/dashboard.js Outdated
Comment thread src/utils/relay-probe-history.ts Outdated
Pin network health timeline only on explicit selection so polling shows latest probes.
Trim probe history with rank-only ZREMRANGEBYRANK to avoid concurrent trim races.
Merge upstream/main and resolve settings-config spec conflict.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants