Skip to content

Conversation

@fulleni
Copy link
Member

@fulleni fulleni commented Nov 25, 2025

Status

READY

Description

This pull request primarily focuses on a significant refactoring effort to align the project with updates in its core dependency. Key changes include renaming application settings models and their associated logic from 'UserAppSettings' to 'AppSettings' for improved clarity. Furthermore, it introduces structured models for handling Firebase and OneSignal push notification requests, moving away from ad-hoc map constructions. These changes enhance maintainability and prepare the codebase for future feature development related to push notifications and application settings.

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

- Update git ref in pubspec.yaml and pubspec.lock
- Change ref from 064c4387b3f7df835565c41c918dc2d80dd2f49a to c0c41c069b885f0c16d1b134269aa068616341
…ames

- Rename UserAppSettings to AppSettings in repository and logger
- Adjust repository and logger names for userContentPreferences and pushNotificationDevice
- Replace UserAppSettings with AppSettings in data operation registry
- Update related data repository references
- Adjust type casting in update operations
- Rename UserAppSettings to AppSettings
- Simplify getOwnerId function
- Update permissions configuration
- Update collection name in AppDependencies
- Update related permissions in Permissions class
- Update DataOperationRegistry to use new collection name
- Update ModelRegistry to reflect new collection name
- Update DatabaseSeedingService to use new collection name

These changes ensure consistency across the codebase and database, using the more appropriate "app_settings" collection name instead of "user_app_settings".
- Update UserAppSettings to AppSettings in AuthService
- Rename feedPreferences to feedSettings and update related properties
- Adjust class names and method calls to reflect new naming conventions
- Update ad config setup in initial configuration
- Modify app settings structure for user creation
- Refactor user deletion process to remove app settings
- Adjust feed preferences to feed settings in default app settings
- Modify the retrieval path for user limits from remote configuration
- Update variable names to reflect the new structure of limits configuration
- Adjust the limits retrieval logic for different user roles
…mapping

- Replace payload.body with payload.title in notification body
- Reconstruct data payload from explicit fields instead of using payload.data directly
- Update data payload structure to include specific notification details
- Map notification title to 'contents' instead of body
- Remove direct payload.data mapping and replace with individual fields
- Add 'notificationId', 'notificationType', 'contentType', and 'contentId' to data payload
- Corrected the structure of the PushNotificationPayload
- Removed unnecessary fields (body, data)
- Added new fields (notificationId, notificationType, contentType, contentId)
- Simplified the payload object to improve readability and maintainability
- Change remoteConfig.pushNotificationConfig to remoteConfig.features.pushNotifications
- This modification ensures compatibility with the latest remote config structure
- Add FirebaseRequestBody and OneSignalRequestBody models
- Include necessary JSON serialization and equity comparison
- Export new models from push_notification.dart
- Import core package for PushNotificationPayload
- Change data type from Map<String, dynamic> to PushNotificationPayload
…uestBody

- Replace `Map<String, dynamic>` with `PushNotificationPayload` for better type safety
- Import `core` package to include `PushNotificationPayload` definition
…cation

- Replace manual JSON map construction with FirebaseRequestBody model
- Simplify requestBody creation by using FirebaseMessage and FirebaseNotification models
- Remove redundant fields and improve code readability
…equest

- Replace manual JSON construction with OneSignalRequestBody model
- Simplify request body creation by using a dedicated model class
- Improve code readability and maintainability
- Update _fe_analyzer_shared from 91.0.0 to 92.0.0
- Update analyzer from 8.4.1 to 9.0.0
- Add build_runner and json_serializable dev dependencies
- Update other dependencies including build, build_config, build_daemon,
  checked_yaml, code_builder, dart_style, graphs, pubspec_parse,
  source_gen, source_helper
- Update test from 1.26.3 to 1.28.0 and related test dependencies
- Add 'cast_nullable_to_non_nullable: ignore' to analysis_options.yaml
- This change allows ignoring issues related to casting nullable types to non-nullable types
…ation models

- Add firebase_request_body.g.dart: generated code for FirebaseRequestBody serialization
- Add onesignal_request_body.g.dart: generated code for OneSignalRequestBody serialization
- Adds createFactory: false to the @JsonSerializable annotation in multiple model classes to prevent the generation of `fromJson` factory methods.
- This change affects FirebaseRequestBody, FirebaseMessage, FirebaseNotification, and OneSignalRequestBody classes.
- Change DataRepository<UserAppSettings> to DataRepository<AppSettings>
@fulleni fulleni self-assigned this Nov 25, 2025
@gemini-code-assist
Copy link

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 primarily focuses on a significant refactoring effort to align the project with updates in its core dependency. Key changes include renaming application settings models and their associated logic from 'UserAppSettings' to 'AppSettings' for improved clarity. Furthermore, it introduces structured models for handling Firebase and OneSignal push notification requests, moving away from ad-hoc map constructions. These changes enhance maintainability and prepare the codebase for future feature development related to push notifications and application settings.

Highlights

  • Core Package Update: The project has been synchronized with an updated core package, indicated by changes in pubspec.yaml and pubspec.lock.
  • Refactoring of App Settings: The UserAppSettings model and related services, repositories, and permissions have been refactored and renamed to AppSettings for clarity and consistency across the codebase.
  • Push Notification Model Introduction: New models (FirebaseRequestBody, FirebaseMessage, FirebaseNotification, OneSignalRequestBody) have been introduced for structuring Firebase and OneSignal push notification requests, replacing raw map constructions.
  • Build Configuration Updates: The build configuration has been updated to include build_runner and json_serializable in dev_dependencies to support code generation for the new push notification models.
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.

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 primarily refactors the codebase to align with updates in the core package, which includes renaming UserAppSettings to AppSettings and adapting to changes in RemoteConfig and PushNotificationPayload models. It also commendably introduces typed request body models for push notifications. While the refactoring is largely consistent, I've identified a few critical issues. The most significant is that push notification bodies are incorrectly being set to the notification title. Additionally, there are problems with the JSON serialization of the new request body models, one of which results in non-compilable generated code.

- Updated FirebaseNotification model to make the body field optional
- Fixed a bug in FirebasePushNotificationClient where the notification body was incorrectly set to the payload title
- Remove requirement for contents in OneSignalRequestBody
- Update OneSignalPushNotificationClient to use payload.message instead of payload.title for contents
@fulleni fulleni merged commit 583aa97 into main Nov 25, 2025
1 check failed
@fulleni fulleni deleted the refactor/sync-with-core-package-update branch November 25, 2025 06:42
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.

2 participants