Skip to content

fix: properly parse ProtoJSON body for POST pushNotificationConfigs#352

Merged
ishymko merged 1 commit intomainfrom
ishymko/fix-push-notifications-again
Mar 16, 2026
Merged

fix: properly parse ProtoJSON body for POST pushNotificationConfigs#352
ishymko merged 1 commit intomainfrom
ishymko/fix-push-notifications-again

Conversation

@ishymko
Copy link
Copy Markdown
Member

@ishymko ishymko commented Mar 13, 2026

Apparently the code removed in #346 wasn't "dead", this method wasn't properly migrated in #292.

Tests are updated to cover this.

Fixes #336

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 13, 2026

🧪 Code Coverage

⬇️ Download Full Report

Main PR Delta
src/server/express/rest_handler.ts 85.76% 85.6% 🔴 -0.16%
src/types/converters/from_proto.ts 71.59% 74.88% 🟢 +3.29%
Total 80.84% 81.12% 🟢 +0.28%

Generated by coverage-comment.yml

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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 addresses a regression in the API's ability to correctly parse ProtoJSON request bodies for push notification configurations. The fix ensures that incoming requests to the setTaskPushNotificationConfig endpoint are properly deserialized, restoring expected functionality. Additionally, comprehensive test cases have been added to prevent similar issues in the future and validate correct handling of various ProtoJSON formats.

Highlights

  • ProtoJSON Parsing Fix: Corrected the parsing of ProtoJSON request bodies for the POST /v1/tasks/:taskId/pushNotificationConfigs endpoint, ensuring proper data deserialization.
  • Expanded Test Coverage: Introduced new test cases in rest_handler.spec.ts to validate ProtoJSON parsing for both pushNotificationConfigs and message:send endpoints, covering camelCase and snake_case payload formats.
Changelog
  • src/server/express/rest_handler.ts
    • Replaced manual request body processing with a2a.CreateTaskPushNotificationConfigRequest.fromJSON to correctly parse ProtoJSON for push notification configurations.
  • test/server/express/rest_handler.spec.ts
    • Added new test cases for POST /v1/tasks/:taskId/pushNotificationConfigs to verify ProtoJSON parsing for camelCase and snake_case payloads.
    • Expanded test cases for POST /v1/message:send to include camelCase and snake_case message parts and configuration fields, ensuring robust ProtoJSON handling.
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.

@ishymko ishymko force-pushed the ishymko/fix-push-notifications-again branch from f3d7188 to 5c0a1a8 Compare March 13, 2026 14:48
Copy link
Copy Markdown
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 addresses a bug in the POST /v1/tasks/:taskId/pushNotificationConfigs endpoint where the request body was not being parsed correctly as ProtoJSON. The fix correctly implements fromJSON to parse the request body, ensuring proper handling of both camelCase and snake_case fields. The tests have been significantly improved to validate this fix and align with the expected ProtoJSON structures, increasing test coverage and robustness. The changes are well-implemented and effectively resolve the issue.

@ishymko ishymko force-pushed the ishymko/fix-push-notifications-again branch from 5c0a1a8 to d01ab3a Compare March 13, 2026 15:17
Apparently the code removed in #346 wasn't "dead", this method was missed in #292.
@ishymko ishymko force-pushed the ishymko/fix-push-notifications-again branch from d01ab3a to 8937790 Compare March 13, 2026 15:23
@ishymko ishymko marked this pull request as ready for review March 13, 2026 15:23
@ishymko ishymko requested a review from a team as a code owner March 13, 2026 15:23
@ishymko ishymko requested a review from guglielmo-san March 13, 2026 15:59
@ishymko ishymko merged commit 57696a8 into main Mar 16, 2026
15 checks passed
@ishymko ishymko deleted the ishymko/fix-push-notifications-again branch March 16, 2026 10:30
ishymko pushed a commit that referenced this pull request Mar 16, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.3.13](v0.3.12...v0.3.13)
(2026-03-16)


### Bug Fixes

* properly parse ProtoJSON body for POST pushNotificationConfigs
([#352](#352))
([57696a8](57696a8)),
closes [#336](#336)

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
ikubicki pushed a commit to ikubicki/a2a-js that referenced this pull request Mar 19, 2026
…2aproject#352)

Apparently the code removed in a2aproject#346 wasn't "dead", this method wasn't
properly migrated in a2aproject#292.

Tests are updated to cover this.

Fixes a2aproject#336
ikubicki pushed a commit to ikubicki/a2a-js that referenced this pull request Mar 19, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.3.13](a2aproject/a2a-js@v0.3.12...v0.3.13)
(2026-03-16)


### Bug Fixes

* properly parse ProtoJSON body for POST pushNotificationConfigs
([a2aproject#352](a2aproject#352))
([57696a8](a2aproject@57696a8)),
closes [a2aproject#336](a2aproject#336)

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

[Bug]: Push Configuration Config gets removed from config in rest handler

2 participants