Skip to content

Fix Core retry API version after token renewal - #568

Merged
mesilov merged 1 commit into
v3-devfrom
bugfix/544-preserve-api-version-on-token-renew
Aug 5, 2026
Merged

Fix Core retry API version after token renewal#568
mesilov merged 1 commit into
v3-devfrom
bugfix/544-preserve-api-version-on-token-renew

Conversation

@mesilov

@mesilov mesilov commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator
Q A
Bug fix? yes
New feature? no
Deprecations? no
Issues Fix #544
License MIT

Fixes Core::call() retry behavior after OAuth token renewal: when a request is repeated after an expired_token response, the retry now preserves the originally requested API version instead of falling back to ApiVersion::v1.

Additional changes:

  • Added a regression unit test that verifies ApiVersion::v3 is preserved across the expired-token retry path.
  • Added the currently available live scope codes timemanmobile and vibecodeconnector to Scope.
  • Kept the current dependency gates green by updating the Rector config for Rector 2.6.1 and applying the Rector-requested PHPUnit mock attribute.

Test plan

  • make oa-schema-build — passed
  • make lint-cs-fixer — passed, 0/1090 files fixable
  • make lint-rector — passed
  • make lint-phpstan — passed, 2453 files, no errors
  • make lint-deptrac — passed, 0 violations, 0 errors
  • make test-unit — passed, 1222 tests, 3338 assertions
  • Regression test testCallPreservesApiVersionAfterExpiredTokenRenewal — passed, 1 test, 2 assertions
  • Live tests/Integration/Core/Credentials/ScopeTest.php — passed, 1 test, 1 assertion
  • make test-integration-core — attempted twice; blocked by an unrelated live Bitrix24 operation limit in BatchTraversableListTest::testSingleBatchWithDescSortingMore during tearDown() cleanup via crm.contact.delete. The full-suite run reached 24 tests / 3174 assertions before that cleanup error, and the targeted retry reproduced the same external cleanup limit after 1 test / 2512 assertions.

Leftover contacts from the failed live runs were cleaned up by filtering on the failed-run ORIGINATOR_ID values; the final count check returned found=0 for both values.

Closes #544

@mesilov mesilov added this to the 3.5.0 milestone Aug 5, 2026
@mesilov mesilov self-assigned this Aug 5, 2026
@mesilov
mesilov merged commit 8abe445 into v3-dev Aug 5, 2026
10 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.

1 participant