Skip to content

Add report support for Posts and Comments and fix report creation bugs#32

Merged
8JP8 merged 1 commit intomainfrom
add-report-support-post-comment-15231206498711219601
Jan 19, 2026
Merged

Add report support for Posts and Comments and fix report creation bugs#32
8JP8 merged 1 commit intomainfrom
add-report-support-post-comment-15231206498711219601

Conversation

@google-labs-jules
Copy link
Copy Markdown
Contributor

This PR addresses the issue of missing report support for posts and comments by fixing bugs in how reports are created and retrieved.

Changes:

  1. Refactored Report retrieval methods: Updated get_pending_reports and get_recent_reports in backend/models/report.py to filter by topic_id correctly, with a fallback to legacy reported_message_id lookup to ensure existing reports are still visible. Updated get_user_reports to check reported_user_id.
  2. Fixed Report Creation: Corrected the create_report calls in backend/models/post.py, backend/models/comment.py, and backend/models/message.py to use keyword arguments, ensuring that content_type, content_id, topic_id, and reported_user_id are passed correctly. Previously, incorrect positional arguments were leading to corrupted report data.
  3. Clarified Enrichment Logic: Added comments to _enrich_report_with_details in backend/models/report.py to explicitly document the logic for fetching post and comment details.
  4. Verified: Added a reproduction/test script backend/repro_report.py (which was run and then deleted) to verify the fixes.

PR created automatically by Jules for task 15231206498711219601 started by @8JP8

- Update `backend/models/report.py` to support legacy fallback in `get_pending_reports` and `get_recent_reports` for backward compatibility.
- Ensure `_enrich_report_with_details` correctly fetches post and comment content.
- Fix bugs in `Post.report_post`, `Comment.report_comment`, and `Message.report_message` where `create_report` was called with incorrect positional arguments.
- Add comments to `_enrich_report_with_details` for clarity.
@google-labs-jules
Copy link
Copy Markdown
Contributor Author

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@8JP8 8JP8 marked this pull request as ready for review January 19, 2026 18:52
@8JP8 8JP8 merged commit 68dc8b0 into main Jan 19, 2026
1 check passed
@8JP8 8JP8 deleted the add-report-support-post-comment-15231206498711219601 branch January 19, 2026 18:52
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