finos / symphony-bdk-java

The Symphony BDK (Bot Developer Kit) for Java helps you to create production-grade Chat Bots and Extension Applications on top of the Symphony REST APIs.
https://symphony-bdk-java.finos.org
Apache License 2.0
23 stars 69 forks source link

Retry is running when client error 403 happens #596

Closed yinan-symphony closed 2 years ago

yinan-symphony commented 2 years ago

Bug Report

When the bot is sending a list room members request (through streamService.listRoomMembers), if the bot is not in the room, the request should be rejected, and no retry should be triggered.

Steps to Reproduce:

  1. call list room members request to a room where the bot is not in

Expected Result:

request is rejected, no retry

Actual Result:

2021-12-02 11:43:55.754 CET retry is triggered, here is the log

02 Dec 2021 10:43:55,754 ERROR [com.symphony.bdk.core.retry.RetryWithRecovery] (XNIO-1 task-8 - 16471) An unknown error occurred while trying to connect to https://XXX:443/pod. Please check below for more information: {"code":403,"message":"User XXX is neither an admin nor a member of the specified rooms"} " timestamp: "2021-12-02T10:43:55.754724151Z" }

Environment:

Production

Additional Context:

...add any other context about the problem here. If applicable, add screenshots to help explain...

symphony-youri commented 2 years ago

Hi @yinan-symphony

If the BDK retries then you should see a Retry in ... log. By default the BDK retries on those conditions: https://github.com/finos/symphony-bdk-java/blob/3aba11eae54ae1fcc2088a61a1fb47bbd2cbc791/symphony-bdk-core/src/main/java/com/symphony/bdk/core/retry/RetryWithRecoveryBuilder.java#L84 so it should not retry on 403 errors.

The error is indeed captured by the RetryWithRecovery logger which can be misleading.

yinan-symphony commented 2 years ago

thank you very much for your support @symphony-youri