Skip to content

[Bug in SDK]: Infinite recursion in call() #372

@hydrotinker

Description

@hydrotinker

version(s) affected

1.10.0

Description

If a 302 error is returned when calling any REST method, and it is not related to a domain change, the request gets stuck in a loop and does not exit.

How to reproduce

We've encountered this error several times when accessing the self-hosted portal with an expired license. These portals redirect any request to "/bitrix/coupon_activation.php" page.

In .../bitrix24/b24phpsdk/src/Core/Core.php -> method call():

  1. We call $apiCallResponse = $this->apiClient->getResponse($apiMethod, $parameters);
  2. $apiCallResponse->getStatusCode() returns StatusCodeInterface::STATUS_FOUND
  3. It tries to replace portal's old domain with the new one (which is identical), and then do $response = $this->call($apiMethod, $parameters); which is the same query.

Manual handling with custom listener on app level is impossible as well as only event happens AFTER recursive method.

Possible Solution

Having this case handled at the package level is ideal. Or at least having additional event before the call is advised

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug in SDKSomething isn't working in SDK

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions