Skip to content

Conversation

@botraunak
Copy link
Contributor

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 the DefaultRequestHandler.
Provided interface for push notification store which can be extended
Added a default implementation in DefaultRequestHandler.

Added support when pushNotification config available in messageSendParams

Existing push notification tests still pass
Added new test to ensure push notifications are being called

Fixes #89 🦕

Copy link
Contributor

@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.

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

  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
Contributor

@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 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.

@botraunak
Copy link
Contributor Author

@swapydapy I have updated the pull request with the necessary changes please review.

@swapydapy
Copy link
Contributor

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
@botraunak botraunak force-pushed the feat/push_notifications branch from 4af70c4 to b3e4d70 Compare August 18, 2025 05:19
@swapydapy
Copy link
Contributor

@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
@botraunak
Copy link
Contributor Author

@swapydapy I've made the requested changes. Let me know.

Copy link
Contributor

@swapydapy swapydapy left a 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.

@botraunak botraunak closed this Aug 22, 2025
@botraunak botraunak deleted the feat/push_notifications branch August 22, 2025 13:41
@botraunak botraunak restored the feat/push_notifications branch August 22, 2025 13:41
@botraunak botraunak reopened this Aug 22, 2025
@botraunak
Copy link
Contributor Author

@swapydapy I have added more tests for the configuration changes in default notification sender. Please review the other requested changes as well.

@botraunak botraunak requested a review from swapydapy August 22, 2025 17:41
@swapydapy
Copy link
Contributor

The new tests make this very robust. Just final nits to polish the testcases, and we can merge this.

@botraunak
Copy link
Contributor Author

botraunak commented Aug 27, 2025

@swapydapy Made the relevant changes, please help resolve the review comment for task store dependency removal then we can merge it.

@swapydapy
Copy link
Contributor

Also please update the readme, so devs are aware of the push notification interfaces.

@botraunak
Copy link
Contributor Author

@swapydapy Please review.

@botraunak botraunak requested a review from swapydapy August 28, 2025 12:25
@swapydapy swapydapy merged commit 45a211a into a2aproject:main Aug 31, 2025
2 checks passed
swapydapy pushed a commit that referenced this pull request Sep 4, 2025
🤖 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).
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.

[Feat]: Push Notifications Support

2 participants