-
-
Notifications
You must be signed in to change notification settings - Fork 6
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
fix(user/followers): return actor url #87
Conversation
not sure what AP spec says. But this should be better for Mastodon et.al?
WalkthroughThe pull request introduces a modification in the Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
crates/api_apub/src/users/user_followers.rs (1)
81-81
: Consider more robust error handling for follower URLs
Relying on.filter_map(Result::ok)
means any parsing errors will silently drop followers from the collection. If invalid or malformed URLs are unexpected, consider logging or returning an error rather than ignoring them. This ensures more transparent error reporting and helps diagnose faulty data.Below is an example change to explicitly handle parsing failures:
.map(|follow| { - Url::parse(&follow.actor) -}) -.filter_map(Result::ok) +.map(|follow| { + match Url::parse(&follow.actor) { + Ok(url) => Some(url), + Err(e) => { + // Consider logging or returning an error here + tracing::warn!("Invalid follower URL: {}", e); + None + } + } +}) +.flatten()
Indeed, it seems I accidentally made a mistake. Thank you for your contribution! |
First up, I'm not sure what the ActivityPub spec says.
But using the "id" used by hatsu in the followers collection does seem strange to me. At least all the "URLs" in the collection lead to a 404 page. It seems using the actual "actor" (follower) URL is better? At least a tool like https://browser.pub seems to deal better with that. (See e.g. https://browser.pub/https://blog.uvokchee.de).
What do you think?
Summary by CodeRabbit