Skip to content

Title: TypeError in SummaryCounters constructor when systemUpdates is false #265

@p123-stack

Description

@p123-stack

Describe the bug
When executing a query using the Laudis Neo4j PHP client, a TypeError is thrown due to an unexpected false value passed to the SummaryCounters constructor for the systemUpdates parameter. This issue occurs only in rare cases, when the Neo4j server returns false for the system-updates key in the summary statistics, whereas the constructor expects an int.

To Reproduce
Steps to reproduce the behavior:

  1. Run a query that triggers SummaryCounters creation, e.g., a MATCH or write query.
  2. Ensure the Neo4j server returns false for the system-updates key in summary statistics (you can inspect this with a debugger or log $stats).
  3. Observe the error being thrown when the client tries to instantiate SummaryCounters.

Expected behavior
The client should gracefully handle the case where system-updates is false, either by casting it to 0 or checking for its type. The result formatting should not throw a type error due to mismatched data from Neo4j.

Environment (please complete the following information):

  • PHP version: 8.3.4
  • laudis/neo4j-php-client: 3.0.6
  • neo4j: v4 or v5
  • Ubuntu 22.04.4 LTS

Additional context
This issue was previously mentioned in a comment on a closed issue:
🔗 #203 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions