Skip to content

Conversation

@fulleni
Copy link
Member

@fulleni fulleni commented Nov 8, 2025

Status

READY

Description

This pull request introduces a significant refactoring of the push notification system's configuration and device models. The primary goal is to delegate the management of push notification providers to the backend and centralizing the storage of provider-specific device tokens within the PushNotificationDevice model itself. This change streamlines the data structures, making the system more cohesive and easier to maintain, albeit introducing breaking changes due to the altered data models.

Type of Change

  • ✨ New feature (non-breaking change which adds functionality)
  • 🛠️ Bug fix (non-breaking change which fixes an issue)
  • ❌ Breaking change (fix or feature that would cause existing functionality to change)
  • 🧹 Code refactor
  • ✅ Build configuration change
  • 📝 Documentation
  • 🗑️ Chore

…rTokens map

- Remove `token` and `provider` properties
- Add `providerTokens` map to store tokens for multiple providers
- Update JSON serialization and deserialization for the new `providerTokens` map
- Adjust `props` and `copyWith` methods to accommodate the new change
- Remove FirebaseProviderConfig, OneSignalProviderConfig, and PushNotificationProviderConfig
- Update imports and exports in config.dart
- Simplify PushNotificationConfig by removing providerConfigs
- Removed hardcoded example values for push notification configurations
- This change improves security by eliminating sensitive data in the codebase
- It also enhances code clarity by removing specific configuration examples
- Remove FirebaseProviderConfig tests
- Remove OneSignalProviderConfig tests
- Remove PushNotificationProviderConfig tests
- All related test files have been deleted
- Remove providerConfigs from the equality comparison in PushNotificationConfig test
- Exclude providerConfigs when copying and comparing PushNotificationConfig instances
- Replace single token and provider with map of provider tokens
- Update test cases to reflect new providerTokens structure
- Adjust JSON representation to include multiple provider tokens
- Modify copyWith test to use new providerTokens map
@gemini-code-assist
Copy link

gemini-code-assist bot commented Nov 8, 2025

Summary of Changes

Hello @fulleni, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a significant refactoring of the push notification system's configuration and device models. The primary goal is to delegate the management of push notification providers to the backend and centralizing the storage of provider-specific device tokens within the PushNotificationDevice model itself. This change streamlines the data structures, making the system more cohesive and easier to maintain, albeit introducing breaking changes due to the altered data models.

Highlights

  • Simplified Push Notification Configuration: The PushNotificationConfig model has been streamlined by removing the providerConfigs map, which previously held specific configurations for different push notification providers like Firebase and OneSignal. This simplifies the overall structure of the push notification settings.
  • Centralized Provider Tokens in Device Model: The PushNotificationDevice model has been refactored to replace individual token and provider fields with a single providerTokens map. This map now stores tokens for various push notification providers (e.g., Firebase, OneSignal) associated with a device, centralizing token management.
  • Removal of Specific Provider Configuration Models: Dedicated models for FirebaseProviderConfig, OneSignalProviderConfig, and their abstract base PushNotificationProviderConfig have been removed, along with their generated part files and associated test files. This change reflects the new approach of handling provider-specific data directly within the PushNotificationDevice.
  • Updated Serialization Logic: The PushNotificationConfig and PushNotificationDevice models' serialization and deserialization logic (in their .g.dart files) have been updated to reflect the removal of providerConfigs and the introduction of providerTokens, respectively, ensuring data consistency with the new structure.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@fulleni fulleni self-assigned this Nov 8, 2025
@fulleni fulleni added this to the Market Contender Edition milestone Nov 8, 2025
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a significant and beneficial refactoring of the push notification configuration. By removing provider-specific credentials from the remote config, you've greatly improved security. The change to PushNotificationDevice to support multiple provider tokens per device is a smart move that increases flexibility. The code is clean, and the changes are consistently applied across all relevant models, fixtures, and tests. I have one minor suggestion to clean up a comment.

- Remove incorrect dartdoc tag 'push_notification_provider_config'
- Improve documentation formatting for PushNotificationConfig class
@fulleni fulleni merged commit d047d9c into main Nov 8, 2025
1 of 2 checks passed
@fulleni fulleni deleted the refactor/push-notification branch November 8, 2025 09:26
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.

refactor: refactore the push notification system's configuration and device

2 participants