Skip to content

Conversation

@Sathyvs
Copy link
Contributor

@Sathyvs Sathyvs commented Jan 17, 2026

Changes related to PushNotificationConfig pagination feature

Description

Addressed PR comments and nitpicks from PR 564

Fixes #553 🦕

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @Sathyvs, 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 refines the pagination feature for PushNotificationConfig by introducing a configurable maximum page size and implementing more robust error handling for invalid page tokens. These changes aim to improve the stability and predictability of pagination, ensuring that API requests for configuration listings are handled efficiently and that malformed requests are met with explicit error messages. The update also enhances the flexibility of configuration management by allowing default properties to be overridden more easily.

Highlights

  • Configurable Maximum Page Size: Introduced a configurable maximum page size for listing push notification configurations. This allows the system to enforce limits on requested page sizes, defaulting to 100 but enabling overrides via the A2AConfigProvider.
  • Enhanced Page Token Validation: The getInfo method now includes stricter validation for the pageToken format. Malformed tokens will explicitly throw an InvalidParamsError, providing clearer feedback to API consumers instead of silently ignoring invalid input.
  • Refactored Page Token Parsing: The internal logic for parsing the pageToken into its timestamp and ID components has been refactored for improved clarity and to facilitate earlier validation within the getInfo method.
  • Improved Test Coverage for Pagination: New integration tests have been added to verify the page size capping functionality. Existing tests were updated to reflect the new InvalidParamsError behavior when encountering malformed page tokens, ensuring robust error handling.
  • Configurable Default Properties Loading: The mechanism for loading default configuration properties has been made configurable. This allows for easier management of environment-specific or test-specific default property files, as demonstrated by the addition of a2a-test-defaults.properties.
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
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 feedback from a previous one, primarily by making the page size for push notification configuration pagination configurable. The changes are generally well-implemented. I've identified a few areas for improvement: enhancing the robustness of configuration loading, correcting some inconsistencies in a new test case, and resolving a duplicate dependency in a pom.xml file. My detailed comments provide specific suggestions for each of these points.

Comment on lines 100 to 103
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-arc</artifactId>
</dependency>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

This change introduces a duplicate dependency on io.quarkus:quarkus-arc. An existing dependency is declared on lines 63-84 with test scope. Having duplicate dependencies can cause issues with dependency resolution and is generally bad practice.

Please remove this new dependency block. If quarkus-arc is needed at compile time, the scope of the existing dependency declaration should be changed from test to compile (by removing the <scope>test</scope> element).

Comment on lines 54 to 56
void initConfig() {
maxPageSize = Integer.parseInt(configProvider.getValue(A2A_PUSH_NOTIFICATION_MAX_PAGE_SIZE));
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The initConfig method is not robust against potential configuration errors. If the a2a.push-notification-config.max-page-size property is misconfigured with a non-numeric value, Integer.parseInt will throw a NumberFormatException, causing the application startup to fail. While failing fast is a valid strategy for configuration errors, a more resilient approach would be to handle this exception, log a warning, and fall back to a sensible default value (e.g., 100, as mentioned in the Javadoc).

    void initConfig() {
        try {
            maxPageSize = Integer.parseInt(configProvider.getValue(A2A_PUSH_NOTIFICATION_MAX_PAGE_SIZE));
        } catch (NumberFormatException | IllegalArgumentException e) {
            LOGGER.warn("Failed to read '{}' configuration, falling back to default page size of 100.", A2A_PUSH_NOTIFICATION_MAX_PAGE_SIZE, e);
            maxPageSize = 100;
        }
    }

Comment on lines 567 to 569
// Should return 2 configs (capped to maxPageSize from test config), not 5
assertEquals(5, result.configs().size(),
"Page size should be capped to configured maxPageSize (5 in tests) when requested size exceeds limit");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The comment on line 567 is misleading. It states that 2 configs should be returned, but the test's configured maxPageSize is 5, and the assertion correctly checks for 5. The comment should be updated to reflect the actual expected behavior.

Suggested change
// Should return 2 configs (capped to maxPageSize from test config), not 5
assertEquals(5, result.configs().size(),
"Page size should be capped to configured maxPageSize (5 in tests) when requested size exceeds limit");
// Should return 5 configs (capped to maxPageSize from test config), not 7
assertEquals(5, result.configs().size(),
"Page size should be capped to configured maxPageSize (5 in tests) when requested size exceeds limit");

Comment on lines 587 to 588
assertEquals(7, allConfigIds.size(),
"Should retrieve all 5 configs across multiple pages");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The assertion message here contains a typo. It should state that all 7 configs are expected to be retrieved, not 5.

Suggested change
assertEquals(7, allConfigIds.size(),
"Should retrieve all 5 configs across multiple pages");
assertEquals(7, allConfigIds.size(),
"Should retrieve all 7 configs across multiple pages");

@Sathyvs Sathyvs closed this Jan 17, 2026
@Sathyvs Sathyvs force-pushed the pushnotification_pagination_fixes branch from 97d6644 to 1277f24 Compare January 17, 2026 04:18
@Sathyvs Sathyvs deleted the pushnotification_pagination_fixes branch January 17, 2026 04:23
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]: Use Jpa to paginate in JpaDatabasePushNotificationConfigStore

1 participant