Skip to content

Conversation

@google-labs-jules
Copy link
Contributor

@google-labs-jules google-labs-jules bot commented Sep 1, 2025

Fix #2079

As a user, when someone likes my photos or posts, I'd like to see it on my timeline page. This change adds like events to the timeline for photos and posts.

image

This feature adds a new event type to the timeline for when a user's photo or post is liked.

- Modifies `TimelineService` to include `Like` events in the timeline query.
- Adds new partials to render the like events, including a snippet of the liked item (photo or post).
- Makes the `event_description` helper more resilient to missing templates.
@google-labs-jules
Copy link
Contributor Author

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

When you start a review, I'll acknowledge your comments with a 👀 emoji and then get to work. 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!

I will automatically address your feedback on specific files or sections of files. For any comments you don't want me to act on, just include `(aside)`.

PS: Responding to comments on the entire PR are not yet supported but coming soon.


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

This feature adds a new event type to the timeline for when a user's photo or post is liked.

- Modifies `TimelineService` to include `Like` events in the timeline query.
- Adds new partials to render the like events, including a snippet of the liked item (photo or post).
- Makes the `event_description` helper more resilient to missing templates.
- Fixes a `PG::DatatypeMismatch` error in the timeline query by ensuring the `crop_id` column in the `likes_query` is a proper `NULL` value.
Copy link
Collaborator

@CloCkWeRX CloCkWeRX left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fails tests with

11s
Run bundle exec rspec spec/services/ -fd --fail-fast
Run options: include {:focus=>true}

All examples were filtered out; ignoring {:focus=>true}

Randomized with seed 62296

TimelineService
  everyone's timeline
    example at ./spec/services/timeline_service_spec.rb:44 (FAILED - 1)

Failures:

  1) TimelineService everyone's timeline 
     Failure/Error: it { expect(subject[2].event_type).to eq 'seed' }

     ActiveRecord::StatementInvalid:
       PG::DatatypeMismatch: ERROR:  UNION types integer and text cannot be matched
       LINE 1: ...ded_at" IS NULL) ) "plantings") UNION ALL (SELECT "likes".* ...
                                                                    ^
     # ./spec/services/timeline_service_spec.rb:44:in `block (3 levels) in <top (required)>'
     # ------------------
     # --- Caused by: ---
     # PG::DatatypeMismatch:
     #   ERROR:  UNION types integer and text cannot be matched
     #   LINE 1: ...ded_at" IS NULL) ) "plantings") UNION ALL (SELECT "likes".* ...
     #                                                                ^
     #   ./spec/services/timeline_service_spec.rb:44:in `block (3 levels) in <top (required)>'

@CloCkWeRX CloCkWeRX marked this pull request as ready for review September 1, 2025 10:06
@CloCkWeRX CloCkWeRX merged commit 0079513 into dev Sep 1, 2025
16 checks passed
@CloCkWeRX CloCkWeRX deleted the feature/timeline-likes branch September 1, 2025 10:21
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.

add likes to timeline page

2 participants