Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue in InstabugOkhttpInterceptor: isFileDownload Flag Not Reset, Causing Inconsistent Response Logging #487

Open
Zishanr opened this issue Oct 18, 2024 · 1 comment

Comments

@Zishanr
Copy link

Zishanr commented Oct 18, 2024

Steps to Reproduce the Problem

There is a issue in the InstabugOkhttpInterceptor class of the Instabug Android SDK. The isFileDownload flag, used to determine if an API call response body should be logged, remains true across multiple API calls. This results in inconsistent logging of the response body, especially for file download APIs, where sometimes the response body is not captured.

  1. Implement the InstabugOkhttpInterceptor in an Android project with APIs that include both standard and file download requests.
  2. Make several API calls, including file download first and then non-file download requests.
  3. Observe the response logging behaviour.

Flag in Instabug library codebase

Screenshot 2024-10-18 at 4 13 40 PM

Missing body from the response (Instabug dashboard screenshot)

Screenshot 2024-10-18 at 4 43 28 PM

Expected Result of response (Instabug dashboard screenshot)
Screenshot 2024-10-18 at 5 22 37 PM

Expected Behavior

Each API call's response body should be logged consistently, with the isFileDownload flag properly resetting between API calls.

Actual Behavior

Once the isFileDownload flag is set to true for a file download API call, it does not reset. This prevents response bodies from being logged in subsequent API calls, leading to inconsistent network logs.

Additional Information:

Issue appears when: Multiple API calls are made in quick succession, potentially involving file downloads.
Relevant code section: The handling of the isFileDownload flag inside InstabugOkhttpInterceptor.

Instabug integration code

Make sure to remove your app token.

SDK Version

13.4.1

Android Version

15

Device Model

Samsung S23

[Optional] Project That Reproduces the Issue

@yaraabdelhakiim
Copy link

Hi @Zishanr, thank you for reporting this 🙏🏻 We're aware of this issue and it will be fixed in the next release.

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

No branches or pull requests

2 participants