Conversation
Co-authored-by: GitHub Actions <noreply@github.com>
Co-authored-by: Renaud Chaput <renchap@gmail.com>
| scope = scope.where(id: ..max_id) if max_id.present? | ||
|
|
||
| most_recent_notifications = scope.order(id: :desc).take(0) | ||
| most_recent_id = most_recent_notifications.first.id |
There was a problem hiding this comment.
💡 Performance
The line most_recent_id = most_recent_notifications.first.id will raise an error if most_recent_notifications is empty. You should check if most_recent_notifications is not empty before accessing first.id.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
✨
Description by Cal
PR Description
This PR introduces a new configuration for PR reviews, updates various action creators to use typed actions, modifies notification handling, and updates translations and serializers.
Key Issues
None
Files Changed
File: /.callstack.yaml
Added configuration for PR review modules including bug hunter and performance checks.File: /.github/workflows/reviewer.yml
Created a GitHub Actions workflow for PR review with input parameters for configuration and commit SHAs.File: /.rubocop_todo.yml
Updated RuboCop configuration to reflect the new version and adjusted excluded files.File: /app/controllers/api/v2_alpha/notifications_controller.rb
Modified the rendering of notifications to include max_id for grouping.File: /app/javascript/mastodon/actions/streaming.js
Updated dispatch for disconnectTimeline to include an object instead of a string.File: /app/javascript/mastodon/actions/timelines.js
Refactored timeline delete action to use a typed action creator.File: /app/javascript/mastodon/actions/timelines_typed.ts
Introduced typed action creators for disconnectTimeline and timelineDelete.File: /app/javascript/mastodon/features/account_timeline/index.jsx
Updated dispatch for disconnectTimeline to include an object instead of a string.File: /app/javascript/mastodon/locales/ko.json
Updated Korean translations for follow back and mutual follow.File: /app/javascript/mastodon/reducers/compose.js
Refactored to use the new timelineDelete action type.File: /app/javascript/mastodon/reducers/contexts.js
Updated to use the new timelineDelete action type.File: /app/javascript/mastodon/reducers/modal.ts
Updated to use the new timelineDelete action type.File: /app/javascript/mastodon/reducers/notifications.js
Updated to use the new timelineDelete action type.File: /app/javascript/mastodon/reducers/picture_in_picture.ts
Updated to use the new timelineDelete action type.File: /app/javascript/mastodon/reducers/statuses.js
Updated to use the new timelineDelete action type.File: /app/javascript/mastodon/reducers/timelines.js
Updated to use the new timelineDelete and disconnectTimeline action types.File: /app/javascript/mastodon/store/typed_functions.ts
Refactored thunk types to include action arguments.File: /app/models/notification_group.rb
Updated from_notification method to accept max_id for notifications.File: /app/serializers/rest/notification_serializer.rb
Added group_key attribute to the notification serializer.