Federated reviews from followed users bleed into local user's profile and diary view #9

Closed
opened 2026-06-30 01:16:53 +00:00 by GKaszewski · 0 comments
Owner

This was generated by AI during triage.

Bug description

After following a remote user (on a different instance), their federated reviews appear in the local user's own Profile tab and Diary view as if they were the local user's own entries. The Home/Feed view correctly attributes them to the remote user with a globe 🌐 indicator.

Steps to reproduce

  1. Create a fresh account on instance A
  2. Follow a user on instance B (federation backfill runs, pulling their reviews into instance A's DB)
  3. Open your own Profile tab on instance A
  4. See the followed user's reviews listed as your own — even though your "Movies" stat is 0

Expected behaviour

  • Profile and Diary views show only local reviews (remote_actor_url IS NULL)
  • Federated content from followed users appears only in the Feed view

Root cause

The diary SQL query (query_diary) is missing an AND r.remote_actor_url IS NULL filter. Federated reviews are stored in the same reviews table with the local user's synthetic UUID as user_id, so a bare WHERE r.user_id = ? also matches federated entries.

-- current (broken)
WHERE r.user_id = ?

-- fix
WHERE r.user_id = ? AND r.remote_actor_url IS NULL

The same filter is already present on other queries (get_user_history, count_local_posts, etc.) but was missed in query_diary.

Fix

Already applied in both SQLite and PostgreSQL adapters:

  • crates/adapters/sqlite/src/diary.rs
  • crates/adapters/postgres/src/diary.rs

Needs deployment to affected instances.

Screenshots

Profile shows 0 Movies stat but lists the remote user's full diary:

![Profile showing remote entries](attached — Screenshot_20260630_031422)

Home/Feed correctly shows the same entries attributed to the remote user with 🌐:

![Feed correctly attributed](attached — Screenshot_20260630_031544)

> *This was generated by AI during triage.* ## Bug description After following a remote user (on a different instance), their federated reviews appear in the local user's own **Profile** tab and **Diary** view as if they were the local user's own entries. The **Home/Feed** view correctly attributes them to the remote user with a globe 🌐 indicator. ## Steps to reproduce 1. Create a fresh account on instance A 2. Follow a user on instance B (federation backfill runs, pulling their reviews into instance A's DB) 3. Open your own Profile tab on instance A 4. See the followed user's reviews listed as your own — even though your "Movies" stat is 0 ## Expected behaviour - Profile and Diary views show **only local reviews** (`remote_actor_url IS NULL`) - Federated content from followed users appears only in the **Feed** view ## Root cause The diary SQL query (`query_diary`) is missing an `AND r.remote_actor_url IS NULL` filter. Federated reviews are stored in the same `reviews` table with the local user's synthetic UUID as `user_id`, so a bare `WHERE r.user_id = ?` also matches federated entries. ```sql -- current (broken) WHERE r.user_id = ? -- fix WHERE r.user_id = ? AND r.remote_actor_url IS NULL ``` The same filter is already present on other queries (`get_user_history`, `count_local_posts`, etc.) but was missed in `query_diary`. ## Fix Already applied in both SQLite and PostgreSQL adapters: - `crates/adapters/sqlite/src/diary.rs` - `crates/adapters/postgres/src/diary.rs` Needs deployment to affected instances. ## Screenshots Profile shows 0 Movies stat but lists the remote user's full diary: ![Profile showing remote entries](attached — Screenshot_20260630_031422) Home/Feed correctly shows the same entries attributed to the remote user with 🌐: ![Feed correctly attributed](attached — Screenshot_20260630_031544)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: GKaszewski/movies-diary#9