Skip to content

fix: Fixing missing push configuration after normalization for rest transport#346

Merged
bartek-gralewicz merged 5 commits intomainfrom
bgralewicz/fix_push_config_normalization
Mar 10, 2026
Merged

fix: Fixing missing push configuration after normalization for rest transport#346
bartek-gralewicz merged 5 commits intomainfrom
bgralewicz/fix_push_config_normalization

Conversation

@bartek-gralewicz
Copy link
Copy Markdown
Collaborator

@bartek-gralewicz bartek-gralewicz commented Mar 10, 2026

Description

This PR solves a bug that was mentioned here: #336.

The issue occurred due to missing mapping of pushNotificationConfig in the mapping method. Since mapping is no longer needed, all logic related to field mapping was removed in this PR.

Changes:

  • Extension to an existing unit test to check for pushNotificationConfig presence. This test failed as expected before removing the normalization, hence, catching the bug for the future.
  • Remove rest types and related unions.
  • Removed snake_case cases from unit testes.
  • Removed normalization functions but remained field checks to align with currently existing unit tests.

Fixes #336

…ormalization happens. The test purposely fails at the moment
…nit testes. Removed normalization functions but remained field checks to align with currently existing unit tests.
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 10, 2026

🧪 Code Coverage

⬇️ Download Full Report

Main PR Delta
src/server/transports/rest/rest_transport_handler.ts 96.56% 98.78% 🟢 +2.22%
Total 80.99% 80.84% 🔴 -0.15%

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 critical bug in the REST transport handler where push notification configurations were not being correctly processed. The core of the fix involves a significant simplification of the codebase by removing all explicit normalization logic that previously handled snake_case to camelCase conversions. This change streamlines the data flow, ensuring that parameters are handled directly, and improves the robustness of the system by adding explicit validation checks where normalization was removed. The updated test suite validates these changes and prevents regressions.

Highlights

  • Bug Fix: Resolved a bug where pushNotificationConfig was not correctly mapped due to missing normalization logic in the REST transport handler.
  • Code Simplification: Removed all logic related to field mapping and normalization, as it was no longer needed, simplifying the RestTransportHandler.
  • Type System Refinement: Eliminated REST-specific types and related unions that previously handled snake_case to camelCase conversion.
  • Test Suite Update: Updated unit tests to reflect the removal of snake_case normalization and added a new test case to specifically catch the bug related to pushNotificationConfig.
Changelog
  • src/server/transports/rest/rest_transport_handler.ts
    • Removed imports for REST-specific types like Part, FileWithBytes, FileWithUri, and all Rest* types.
    • Modified sendMessage and sendMessageStream methods to directly use MessageSendParams and include explicit validation for required message fields.
    • Modified setTaskPushNotificationConfig to directly use TaskPushNotificationConfig and include explicit validation for taskId and pushNotificationConfig.
    • Removed all private normalization methods, including normalizeMessageParams, normalizePart, normalizeFile, normalizeMessage, normalizeMessageSendParams, and normalizeTaskPushNotificationConfig.
  • src/server/transports/rest/rest_types.ts
    • Removed the file defining REST-specific snake_case types and input unions.
  • test/server/rest_transport_handler.spec.ts
    • Removed test cases that validated snake_case message input normalization.
    • Updated sendMessage configuration test to use camelCase fields and include pushNotificationConfig.
    • Removed test cases that validated snake_case configuration normalization for setTaskPushNotificationConfig.
    • Removed test cases that validated snake_case file part normalization.
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.

@bartek-gralewicz bartek-gralewicz marked this pull request as ready for review March 10, 2026 12:07
@bartek-gralewicz bartek-gralewicz requested a review from a team as a code owner March 10, 2026 12:07
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

The pull request updates a test case in test/server/rest_transport_handler.spec.ts to include new blocking and push_notification_config properties within the configuration object. These properties are added to both the test input and the expected values in the sendMessage assertion, reflecting an update to the RestTransportHandler's configuration handling.

@bartek-gralewicz bartek-gralewicz merged commit 54ac8c4 into main Mar 10, 2026
14 checks passed
@bartek-gralewicz bartek-gralewicz deleted the bgralewicz/fix_push_config_normalization branch March 10, 2026 15:22
ishymko pushed a commit that referenced this pull request Mar 10, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.3.12](v0.3.11...v0.3.12)
(2026-03-10)


### Bug Fixes

* Fixing missing push configuration after normalization for rest
transport ([#346](#346))
([54ac8c4](54ac8c4))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
bartek-gralewicz added a commit that referenced this pull request Mar 12, 2026
ishymko added a commit that referenced this pull request Mar 13, 2026
Apparently the code removed in #346 wasn't "dead", this method was missed in #292.
ishymko added a commit that referenced this pull request Mar 13, 2026
Apparently the code removed in #346 wasn't "dead", this method was missed in #292.
ishymko added a commit that referenced this pull request Mar 13, 2026
Apparently the code removed in #346 wasn't "dead", this method was missed in #292.
ishymko added a commit that referenced this pull request Mar 13, 2026
Apparently the code removed in #346 wasn't "dead", this method was missed in #292.
ishymko added a commit that referenced this pull request Mar 16, 2026
…352)

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
ikubicki pushed a commit to ikubicki/a2a-js that referenced this pull request Mar 19, 2026
…ransport (a2aproject#346)

# Description

This PR solves a bug that was mentioned here: a2aproject#336.

The issue occurred due to missing mapping of `pushNotificationConfig` in
the mapping method. Since mapping is no longer needed, all logic related
to field mapping was removed in this PR.

Changes:

- Extension to an existing unit test to check for
`pushNotificationConfig` presence. This test failed as expected before
removing the normalization, hence, catching the bug for the future.
- Remove rest types and related unions.
- Removed snake_case cases from unit testes.
- Removed normalization functions but remained field checks to align
with currently existing unit tests.

Fixes a2aproject#336

---------

Co-authored-by: Bartek Gralewicz <bgralewicz@google.com>
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.12](a2aproject/a2a-js@v0.3.11...v0.3.12)
(2026-03-10)


### Bug Fixes

* Fixing missing push configuration after normalization for rest
transport ([a2aproject#346](a2aproject#346))
([54ac8c4](a2aproject@54ac8c4))

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