-
Notifications
You must be signed in to change notification settings - Fork 86
feat: Added push notifications support #108
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
feat: Added push notifications support #108
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Summary of Changes
Hello @botraunak, 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 comprehensive support for push notifications within the Server SDK. It enables the system to send notifications for task updates by defining a new configuration structure, providing an extensible storage interface for these configurations, and integrating a default in-memory implementation. This refactoring centralizes push notification logic and ensures that relevant task status changes trigger configured notifications.
Highlights
- New Push Notification Abstractions: Introduced PushNotificationSender and PushNotificationStore interfaces, along with DefaultPushNotificationSender and InMemoryPushNotificationStore implementations, to modularize push notification handling.
- Refactored Push Notification Storage: The internal Map previously used for storing push notification configurations within DefaultRequestHandler has been replaced by the new PushNotificationStore interface, allowing for more flexible and persistent storage options.
- Automated Notification Dispatch: Integrated logic within DefaultRequestHandler to automatically send push notifications whenever a task's status is updated, leveraging the new PushNotificationSender.
- Configuration Integration: Added support for saving push notification configurations directly from messageSendParams when a new task is created or updated.
- Enhanced Test Coverage: New tests have been added to validate the end-to-end flow of push notification sending upon task status changes.
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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| 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 issue 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
-
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. ↩
There was a problem hiding this 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 robust support for push notifications by adding a PushNotificationStore and a PushNotificationSender, which is a great architectural choice that separates concerns effectively. The DefaultRequestHandler has been cleanly refactored to leverage these new components. The addition of new tests ensures the new functionality is working as expected. I've included a few suggestions to enhance robustness, maintainability, and adherence to best practices, such as adding timeouts to network requests and avoiding parameter mutation.
src/server/push_notification/default_push_notification_sender.ts
Outdated
Show resolved
Hide resolved
|
@swapydapy I have updated the pull request with the necessary changes please review. |
|
Thank you. Requested one additional check for the tests. |
- Send push notifications for all events - Remove blocking calls for sending push notifications - Handle initialization of push notification store and sender based on capabilities in constructor - Remove global mockPushNotification objs for all tests
4af70c4 to
b3e4d70
Compare
|
@botraunak any update. |
- Added more robust complete task object check in case of push notification payload - Added integration test to verify if push notifications are actually called
|
@swapydapy I've made the requested changes. Let me know. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for integration tests, they look great. Just added one main comment to verify full payloads to make these robust to any future bugs.
src/server/push_notification/default_push_notification_sender.ts
Outdated
Show resolved
Hide resolved
src/server/push_notification/default_push_notification_sender.ts
Outdated
Show resolved
Hide resolved
src/server/push_notification/default_push_notification_sender.ts
Outdated
Show resolved
Hide resolved
|
@swapydapy I have added more tests for the configuration changes in default notification sender. Please review the other requested changes as well. |
src/server/push_notification/default_push_notification_sender.ts
Outdated
Show resolved
Hide resolved
|
The new tests make this very robust. Just final nits to polish the testcases, and we can merge this. |
|
@swapydapy Made the relevant changes, please help resolve the review comment for task store dependency removal then we can merge it. |
src/server/push_notification/default_push_notification_sender.ts
Outdated
Show resolved
Hide resolved
|
Also please update the readme, so devs are aware of the push notification interfaces. |
|
@swapydapy Please review. |
🤖 I have created a release *beep* *boop* --- ## [0.3.4](v0.3.3...v0.3.4) (2025-09-04) ### Features * add list and delete task push notification config rpc method and custom rpc methods for extensions ([#119](#119)) ([26c4e7d](26c4e7d)) * Added push notifications support ([#108](#108)) ([45a211a](45a211a)) ### Miscellaneous Chores * release 0.3.4 ([#128](#128)) ([41791d9](41791d9)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Description
Added push notifications support in the Server sdk.
Defines the configuration for setting up push notifications for task updates.
Added an
InMemoryPushNotificationStore, refactored from within theDefaultRequestHandler.Provided interface for push notification store which can be extended
Added a default implementation in
DefaultRequestHandler.Added support when pushNotification config available in
messageSendParamsExisting push notification tests still pass
Added new test to ensure push notifications are being called
Fixes #89 🦕