Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Head1 #3

Open
wants to merge 15 commits into
base: base1
Choose a base branch
from
Open

Head1 #3

wants to merge 15 commits into from

Conversation

hackal
Copy link

@hackal hackal commented Jul 31, 2024

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.

Copy link

Choose a reason for hiding this comment

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

No issues found.

Copy link

@callstackai-action-staging callstackai-action-staging bot left a comment

Choose a reason for hiding this comment

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

No issues found.

Copy link

Choose a reason for hiding this comment

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

No issues found.

Copy link

Choose a reason for hiding this comment

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

No issues found.

scope = notification.account.notifications.where(group_key: notification.group_key)
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

Choose a reason for hiding this comment

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

💡 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.

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.

4 participants