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

[PM-10600] Push notification with full notification center content #5086

Merged
merged 27 commits into from
Feb 12, 2025

Conversation

mzieniukbw
Copy link
Contributor

@mzieniukbw mzieniukbw commented Nov 26, 2024

🎟️ Tracking

https://bitwarden.atlassian.net/browse/PM-10600

This is Part 2.
See Part 1: #4923
See Part 3: #5057

📔 Objective

Notification Center push notification now includes all the fields.

The push notification have a limit of 4KB for payload (limitation of Azure Notification Hub, FCM and APNS). For notification center push notification, only Body field needs to have a max length, since other fields have deterministic max length. No other push notifications are affected.
To fix this, a separate PR will follow once the API PR is merged #4852 that will have the max length of 3000 on the Body field in the request and optionally in db column too.

📸 Screenshots

⏰ Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Protected functional changes with optionality (feature flags)
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team

🦮 Reviewer guidelines

  • 👍 (:+1:) or similar for great changes
  • 📝 (:memo:) or ℹ️ (:information_source:) for notes or general info
  • ❓ (:question:) for questions
  • 🤔 (:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion
  • 🎨 (:art:) for suggestions / improvements
  • ❌ (:x:) or ⚠️ (:warning:) for more significant problems or concerns needing attention
  • 🌱 (:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt
  • ⛏ (:pick:) for minor or nitpick changes

@mzieniukbw mzieniukbw requested review from withinfocus and a team November 26, 2024 07:27
@mzieniukbw mzieniukbw marked this pull request as ready for review November 26, 2024 07:27
Copy link

codecov bot commented Nov 26, 2024

Codecov Report

Attention: Patch coverage is 60.00000% with 16 lines in your changes missing coverage. Please review.

Project coverage is 44.43%. Comparing base (ae9bb42) to head (7e019d1).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...ervices/NotificationsApiPushNotificationService.cs 0.00% 7 Missing ⚠️
...form/Push/Services/RelayPushNotificationService.cs 0.00% 7 Missing ⚠️
...tform/Push/Services/NoopPushNotificationService.cs 0.00% 1 Missing ⚠️
src/Notifications/HubHelpers.cs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5086   +/-   ##
=======================================
  Coverage   44.43%   44.43%           
=======================================
  Files        1500     1500           
  Lines       69521    69546   +25     
  Branches     6262     6262           
=======================================
+ Hits        30890    30905   +15     
- Misses      37304    37314   +10     
  Partials     1327     1327           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

github-actions bot commented Nov 26, 2024

Logo
Checkmarx One – Scan Summary & Details3cc7d25c-9cd0-4af4-8f72-1513d5bbfe72

Great job, no security vulnerabilities found in this Pull Request

@mzieniukbw mzieniukbw changed the title PM-10600: Push notification with full notification center content. [PM-10600] Push notification with full notification center content. Nov 26, 2024
@withinfocus withinfocus changed the title [PM-10600] Push notification with full notification center content. [PM-10600] Push notification with full notification center content Nov 26, 2024
withinfocus
withinfocus previously approved these changes Nov 26, 2024
Copy link
Contributor

@withinfocus withinfocus left a comment

Choose a reason for hiding this comment

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

Makes sense to me. KM team for full review.

Copy link
Contributor

@Thomas-Avery Thomas-Avery left a comment

Choose a reason for hiding this comment

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

LGTM

…ifications

We only register devices for organization push notifications when the organization is being created. This does not work, since we have a use case (Notification Center) of delivering notifications to all users of organization. This fixes it, by adding the organization id tag when device registers for push notifications.
Fixed IFeatureService substitute mocking for Android tests.
Added user part of organization test with organizationId tags expectation.
@rr-bw rr-bw requested review from ike-kottlowski and removed request for rr-bw January 15, 2025 17:32
@mzieniukbw mzieniukbw marked this pull request as draft January 15, 2025 19:32
@mzieniukbw mzieniukbw force-pushed the km/pm-10600-full-notification-content branch from 9a06ab7 to 997165d Compare January 16, 2025 16:14
Notification Center push notification now includes all the fields.
@mzieniukbw mzieniukbw force-pushed the km/pm-10600-full-notification-content branch from 997165d to 02e45c3 Compare January 16, 2025 16:19
@mzieniukbw mzieniukbw marked this pull request as ready for review January 16, 2025 16:22
@mzieniukbw mzieniukbw requested a review from a team as a code owner January 16, 2025 16:22
@mzieniukbw
Copy link
Contributor Author

I had to rebase and force push on top of main, since i could not get git merge working. Nothing have changed, since last time this PR got approved.
I have also self-reviewed the changed to make sure everything is as intended.
Please have a look again and approve.

dani-garcia
dani-garcia previously approved these changes Jan 16, 2025
Thomas-Avery
Thomas-Avery previously approved these changes Jan 16, 2025
ike-kottlowski
ike-kottlowski previously approved these changes Jan 20, 2025
Base automatically changed from km/pm-10600 to main February 12, 2025 15:46
@mzieniukbw mzieniukbw dismissed stale reviews from ike-kottlowski, Thomas-Avery, dani-garcia, and withinfocus February 12, 2025 15:46

The base branch was changed.

# Conflicts:
#	src/Core/Models/PushNotification.cs
#	src/Core/NotificationCenter/Commands/CreateNotificationCommand.cs
#	src/Core/NotificationHub/NotificationHubPushNotificationService.cs
#	src/Core/Platform/Push/Services/AzureQueuePushNotificationService.cs
#	src/Core/Platform/Push/Services/IPushNotificationService.cs
#	src/Core/Platform/Push/Services/MultiServicePushNotificationService.cs
#	src/Core/Platform/Push/Services/NoopPushNotificationService.cs
#	src/Core/Platform/Push/Services/NotificationsApiPushNotificationService.cs
#	src/Core/Platform/Push/Services/RelayPushNotificationService.cs
#	src/Notifications/HubHelpers.cs
#	test/Core.Test/NotificationCenter/Commands/CreateNotificationCommandTest.cs
#	test/Core.Test/NotificationHub/NotificationHubPushNotificationServiceTests.cs
#	test/Core.Test/Platform/Push/Services/AzureQueuePushNotificationServiceTests.cs
#	test/Core.Test/Platform/Push/Services/MultiServicePushNotificationServiceTests.cs
@mzieniukbw mzieniukbw enabled auto-merge (squash) February 12, 2025 16:28
@mzieniukbw mzieniukbw merged commit b98b74c into main Feb 12, 2025
53 checks passed
@mzieniukbw mzieniukbw deleted the km/pm-10600-full-notification-content branch February 12, 2025 16:31
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.

6 participants