Skip to content

Conversation

@vadimsallee
Copy link
Contributor

Q A
Bug fix? yes
New feature? no
Deprecations? no
Issues Fix #246
License MIT

Updated in Core\Batch getTraversableList(), getTraversableListWithCount(); modified BatchOperationsInterface and unit-test NullBatch to be compatible with getTraversableListWithCount(). Added tests into tests/Integration/Core/BatchTraversableListTest.php

Additionally:

  • Run make test-integration-core-list to test the getTraversableList() method

@vadimsallee vadimsallee marked this pull request as ready for review September 12, 2025 06:23
// todo checked that sorting is set as "order": {"ID": "ASC"} i.e. the developer understands that the data will arrive in this order
// todo checked that if there is a limit, then it is >1
// todo checked that there is no ID field in the filter, since we will work with it
// Determine sort direction and ID key
Copy link
Collaborator

Choose a reason for hiding this comment

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

Add link to documentation with explanation for big cost for count operations

/**
* Returns relative path to previous ID value
*/
protected function getReferenceFieldPath(string $prevCommandId, int $lastIndex, string $keyId, bool $isCrmItemsInBatch): string
Copy link
Collaborator

Choose a reason for hiding this comment

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

Add to criteria for get traversableList support for id pointers in previous batch results

/**
* Extracts elements from batch request result
*/
protected function extractElementsFromBatchResult(ResponseData $responseData, bool $isCrmItemsInBatch): array {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Add array shape type hints for result

use PHPUnit\Framework\TestCase;
use Symfony\Component\Uid\Uuid;

#[CoversClass(Batch::class)]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Add test for
$result[request_id][response_field]

Feature

@mesilov mesilov merged commit ebafeb6 into bitrix24:dev Oct 2, 2025
12 checks passed
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.

2 participants