Skip to content

fix firebase sending without additional info#8

Merged
kryakobess merged 1 commit into
mainfrom
feature/hotfix
May 3, 2025
Merged

fix firebase sending without additional info#8
kryakobess merged 1 commit into
mainfrom
feature/hotfix

Conversation

@kryakobess

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI review requested due to automatic review settings May 3, 2025 12:39

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

This PR addresses a Firebase notification sending issue by ensuring that additional data passed to the Firebase Message is never null and by updating the Firebase configuration for the local environment.

  • In NotificationSendingServiceImpl.java, additionalData is now safely defaulted to an empty map when null.
  • In FirebaseConfig.java, the active profile was switched to "local" and new timeout settings were added for better connectivity.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/main/java/ru/randomwalk/twitterservice/service/impl/NotificationSendingServiceImpl.java Added null safety for additionalData using Objects.requireNonNullElseGet.
src/main/java/ru/randomwalk/twitterservice/config/FirebaseConfig.java Changed active profile to "local" and introduced connection timeout configurations.
Comments suppressed due to low confidence (1)

src/main/java/ru/randomwalk/twitterservice/config/FirebaseConfig.java:22

  • [nitpick] Confirm that switching the profile from '!local' to 'local' is intentional for the intended deployment environment.
@Profile("local")

.setNotification(notification)
.setToken(device.getDeviceToken())
.putAllData(additionalData)
.putAllData(Objects.requireNonNullElseGet(additionalData, HashMap::new))

Copilot AI May 3, 2025

Copy link

Choose a reason for hiding this comment

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

[nitpick] Consider adding a log warning when additionalData is null to help trace cases where expected data is missing.

Copilot uses AI. Check for mistakes.
@kryakobess kryakobess merged commit 2498a71 into main May 3, 2025
1 check passed
@kryakobess kryakobess deleted the feature/hotfix branch May 3, 2025 13:50
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.

3 participants