Skip to content
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

Validate post length and comment length and url #195

Merged
merged 3 commits into from
Nov 6, 2024

Conversation

tom-sherman
Copy link
Contributor

@tom-sherman tom-sherman commented Nov 5, 2024

Fixes a bug where you can create a post with a non-url as the url field (eg. empty string), this crashes the app as we do new URL(post.url) on it in a few places and don't expect it to fail.

See https://bsky.app/profile/did:plc:ngokl2gnmpbvuvrfckja3g7p/post/3la6cr7lifz2w

Also added length constraints to the schema to be defensive about that, and applied the same fixes to comments.

I'll need to delete the invalid posts from the DB manually because they should have never been ingested.

Copy link

vercel bot commented Nov 5, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
frontpage ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 5, 2024 10:31am
2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
atproto-browser ⬜️ Ignored (Inspect) Visit Preview Nov 5, 2024 10:31am
unravel ⬜️ Ignored (Inspect) Visit Preview Nov 5, 2024 10:31am

@tom-sherman tom-sherman merged commit ce0f68d into main Nov 6, 2024
8 checks passed
@tom-sherman tom-sherman deleted the more-post-validation branch November 6, 2024 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants