Skip to content

Feat/poll comments vote cache#272

Merged
spe1020 merged 6 commits intomainfrom
feat/poll-comments-vote-cache
Mar 26, 2026
Merged

Feat/poll comments vote cache#272
spe1020 merged 6 commits intomainfrom
feat/poll-comments-vote-cache

Conversation

@spe1020
Copy link
Copy Markdown
Contributor

@spe1020 spe1020 commented Mar 26, 2026

No description provided.

spe1020 and others added 4 commits March 25, 2026 20:31
Add comment support to the polls feed page and replace per-poll vote
subscriptions with an efficient batched vote cache that uses Primal
caching servers for fast initial load and a single live subscription
for real-time updates.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Remove unused imports (userPublickey, ndkConnected) from polls page
- Use `import type` for NDKEvent in voteCache (type-only usage)
- Chunk large vote batches (max 50 IDs per request) to avoid relay
  rejections and oversized Primal requests
- Fix timer leak in relay fetch: clear timeout on eose, use settled
  flag to prevent double-resolve
- Only mark polls as fetched after successful relay completion (not
  on timeout) so future mounts can retry the backfill
- Cap fetchVoteEvents limit to 5000 to keep request size predictable
- Fix fetchPolls pending request type from 'articles' to 'feed'
- Fix rate limit window to bound upper end at event.created_at so
  out-of-order events don't incorrectly filter polls from other hours

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Record fetch start time before the Primal+relay phases and pass it
to the live subscription so votes arriving during the fetch window
are not missed. Reduce Primal vote limit from 5000 to 2000 to keep
request sizes predictable.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages bot commented Mar 26, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
❌ Deployment failed
View logs
frontend 9045b74 Mar 26 2026, 02:39 AM

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages bot commented Mar 26, 2026

Deploying frontend with  Cloudflare Pages  Cloudflare Pages

Latest commit: 9045b74
Status:⚡️  Build in progress...

View logs

@spe1020 spe1020 marked this pull request as ready for review March 26, 2026 02:06
@spe1020 spe1020 merged commit 949eebc into main Mar 26, 2026
1 of 2 checks passed
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.

1 participant