Conversation
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
📝 WalkthroughWalkthroughAdds a new UserMessageService to record subscriber message views with sanitized metadata and persistence; adds convenience view methods and metadata incrementing; renames a repository method and updates call sites; switches REST API parameter to a base URL and updates related placeholders and tests. Changes
Sequence DiagramsequenceDiagram
participant Client as Client
participant Service as UserMessageService
participant SubRepo as SubscriberRepository
participant MsgRepo as MessageRepository
participant UMRepo as UserMessageRepository
participant EM as EntityManager
Client->>Service: trackUserMessageView(uid, messageId, metadata)
Service->>SubRepo: findOneByUid(uid)
SubRepo-->>Service: Subscriber / null
alt Subscriber not found
Service-->>Client: return
end
Service->>MsgRepo: findById(messageId)
MsgRepo-->>Service: Message / null
alt Message not found
Service-->>Client: return
end
Service->>UMRepo: findByUserAndMessage(subscriber, message)
UMRepo-->>Service: UserMessage / null
Service->>Service: mark viewed, MessageMetadata.incrementViews(), sanitize metadata
Service->>EM: persist(UserMessageView)
EM-->>Service: queued
Service-->>Client: done
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 🧹 Recent nitpick comments
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
e487b23 to
4785567
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In `@src/Domain/Configuration/Service/Placeholder/UserTrackValueResolver.php`:
- Line 16: The Autowire parameter name is inconsistent:
UserTrackValueResolver.php uses #[Autowire('%rest_api_base_url%')] while
HttpReceivedStampBuilder.php uses #[Autowire('%app.rest_api_base_url%')]; pick
one canonical container parameter (e.g., %app.rest_api_base_url%) and update the
Autowire attribute in UserTrackValueResolver::__construct (or update
HttpReceivedStampBuilder if you prefer the other name) so both classes reference
the exact same parameter name, or alternatively add a parameter alias in your
service config to map the two names; ensure the class names
UserTrackValueResolver and HttpReceivedStampBuilder and their Autowire
attributes are updated consistently.
In `@src/Domain/Messaging/Service/Builder/HttpReceivedStampBuilder.php`:
- Line 43: The Received header builder in HttpReceivedStampBuilder currently
uses $this->restApiBaseUrl directly in the sprintf, which may include a URL
scheme and produce a non-standard "by" field; modify the builder that constructs
the header (the method returning sprintf('from %s by %s with HTTP; %s', ...)) to
normalize restApiBaseUrl by stripping any scheme (http:// or https://) and
retain only the host (and optional port) before inserting it into the sprintf so
the "by" token is a hostname like api.example.com rather than
https://api.example.com.
src/Domain/Configuration/Service/Placeholder/UserTrackValueResolver.php
Outdated
Show resolved
Hide resolved
05e8f68 to
7c07bd2
Compare
Summary by CodeRabbit
New Features
Enhancements
Refactor
Chores
Tests
Thanks for contributing to phpList!