-
Notifications
You must be signed in to change notification settings - Fork 5
fix: refresh profile metadata during background updates #54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Previously, background profile refreshes only fetched kind 1 (notes), never updating kind 0 (profile metadata). This caused profiles to remain stale indefinitely after initial cache. Now fetch_profile_feed also fetches the latest profile metadata from relays, allowing nostrdb to update cached profiles with newer versions. Fixes: damus-io#52 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
There's some "Transient CI" issue |
|
@coderabbitai review please |
|
✅ Actions performedReview triggered.
|
📝 WalkthroughWalkthroughThe changes introduce parallel background fetching of profile metadata alongside the main profile feed streaming. The Changes
Sequence Diagram(s)sequenceDiagram
participant Caller
participant fetch_profile_feed
participant collect_profile_relays
participant fetch_profile_metadata
participant relay_pool as relay_pool<br/>(streaming)
participant ndb as ndb<br/>(storage)
Caller->>fetch_profile_feed: invoke(relay_pool, ndb, pubkey)
fetch_profile_feed->>collect_profile_relays: get relays for pubkey
collect_profile_relays-->>fetch_profile_feed: relays
par Parallel Execution
fetch_profile_feed->>fetch_profile_metadata: spawn task(relay_pool, ndb, relays, pubkey)
fetch_profile_metadata->>relay_pool: stream kind 0 events
relay_pool-->>fetch_profile_metadata: metadata events
fetch_profile_metadata->>ndb: process & store events
fetch_profile_metadata-->>fetch_profile_metadata: error handling & logging
and
fetch_profile_feed->>relay_pool: stream profile feed events
relay_pool-->>fetch_profile_feed: feed events
fetch_profile_feed->>ndb: process feed data
end
fetch_profile_feed-->>Caller: Result (non-blocking metadata task)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
📜 Recent review detailsConfiguration used: defaults Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used🧬 Code graph analysis (1)src/render.rs (1)
🔇 Additional comments (2)
✏️ Tip: You can disable this entire section by setting Comment |
Summary
fetch_profile_metadata()that runs in parallel with note fetchingTest plan
Fixes #52
🤖 Generated with Claude Code
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.