[GH-ISSUE #1241] Duplicated calls with 0 bytes #1237

Open
opened 2026-03-03 19:49:33 +03:00 by kerem · 31 comments
Owner

Originally created by @ekurdesov on GitHub (May 19, 2022).
Original GitHub issue: https://github.com/ProxymanApp/Proxyman/issues/1241

Originally assigned to: @NghiaTranUIT on GitHub.

Proxyman version? (Ex. Proxyman 1.4.3)

Version 3.5.0 (30500)

macOS Version? (Ex. mac 10.14)

11.6.4 (20G417)

Steps to reproduce

We are seeing multiple calls in proxyman dashboard, there will be 1 call with data returned back but other 3-4 calls will have 0 bytes on it. Tried to get the same results using Charles proxy but can't observe it there.

This was reproduced by my colleague as well and confirmed that Charles proxy isn't showing those duplicated calls.

Expected behavior

Seeing 1 single call in logs instead of 3-4

Screenshots (optional)

Screen Shot 2022-05-19 at 12 39 07 PM
Originally created by @ekurdesov on GitHub (May 19, 2022). Original GitHub issue: https://github.com/ProxymanApp/Proxyman/issues/1241 Originally assigned to: @NghiaTranUIT on GitHub. ### Proxyman version? (Ex. Proxyman 1.4.3) Version 3.5.0 (30500) ### macOS Version? (Ex. mac 10.14) 11.6.4 (20G417) ### Steps to reproduce We are seeing multiple calls in proxyman dashboard, there will be 1 call with data returned back but other 3-4 calls will have 0 bytes on it. Tried to get the same results using Charles proxy but can't observe it there. This was reproduced by my colleague as well and confirmed that Charles proxy isn't showing those duplicated calls. ### Expected behavior Seeing 1 single call in logs instead of 3-4 ### Screenshots (optional) <img width="1419" alt="Screen Shot 2022-05-19 at 12 39 07 PM" src="https://user-images.githubusercontent.com/6412599/169363536-17b171e8-42ab-46aa-a805-65cf852c7469.png">
Author
Owner

@ekurdesov commented on GitHub (May 19, 2022):

the difference between them could vary in like 10-20ms but the only 1 call will have a response with the data.

<!-- gh-comment-id:1132004773 --> @ekurdesov commented on GitHub (May 19, 2022): the difference between them could vary in like 10-20ms but the only 1 call will have a response with the data.
Author
Owner

@Groovee60 commented on GitHub (May 19, 2022):

We also verified that our client code is only making one API call corresponding to these unexpected duplicate traffic listings.

Additionally, it now seems that we can only reproduce the failure immediately after clearing Proxyman's traffic window via the garbage can icon at the top of the screen.

<!-- gh-comment-id:1132015868 --> @Groovee60 commented on GitHub (May 19, 2022): We also verified that our client code is only making one API call corresponding to these unexpected duplicate traffic listings. Additionally, it now seems that we can only reproduce the failure immediately after clearing Proxyman's traffic window via the garbage can icon at the top of the screen.
Author
Owner

@NghiaTranUIT commented on GitHub (May 19, 2022):

Thanks @ekurdesov and @Groovee60 for the report.

Just wondering:

  1. Does it happen with the iOS simulator/device? (it seems that you're an Android team, if you don't mind, please ask a help from the iOS Team).
  2. How about the Android Emulator?

Meanwhile, I will try to reproduce it in my end 👍

<!-- gh-comment-id:1132308914 --> @NghiaTranUIT commented on GitHub (May 19, 2022): Thanks @ekurdesov and @Groovee60 for the report. Just wondering: 1. Does it happen with the iOS simulator/device? (it seems that you're an Android team, if you don't mind, please ask a help from the iOS Team). 2. How about the Android Emulator? Meanwhile, I will try to reproduce it in my end 👍
Author
Owner

@Groovee60 commented on GitHub (May 20, 2022):

Hello, @NghiaTranUIT,

I did reach out to an iOS colleague and he confirmed that he had seen unexpected 0 byte responses. But we have yet to regress the specific steps we were able to nail down. We'll see if we can get further corroboration for you.

When I first saw the multiple API calls, I determined that in some cases, it was a client failure - i.e., I was not inhibiting the user from inadvertently requesting the refresh mechanism twice. When I fixed that, the problem seemed to be resolved, but I soon discovered that the multiple calls could still occur, and later determined that it seemed to require the clearing of the traffic window. None of this makes sense to me, but maybe it will be of assistance to you in reproducing it.

And yes, I was working on a physical device and my colleague was working with an emulator.

Thanks!

<!-- gh-comment-id:1132319322 --> @Groovee60 commented on GitHub (May 20, 2022): Hello, @NghiaTranUIT, I did reach out to an iOS colleague and he confirmed that he had seen unexpected 0 byte responses. But we have yet to regress the specific steps we were able to nail down. We'll see if we can get further corroboration for you. When I first saw the multiple API calls, I determined that in some cases, it *was* a client failure - i.e., I was not inhibiting the user from inadvertently requesting the refresh mechanism twice. When I fixed that, the problem seemed to be resolved, but I soon discovered that the multiple calls could still occur, and later determined that it seemed to require the clearing of the traffic window. None of this makes sense to me, but maybe it will be of assistance to you in reproducing it. And yes, I was working on a physical device and my colleague was working with an emulator. Thanks!
Author
Owner

@NghiaTranUIT commented on GitHub (May 22, 2022):

Thanks for the input. I will investigate this issue this week 👍

<!-- gh-comment-id:1133908370 --> @NghiaTranUIT commented on GitHub (May 22, 2022): Thanks for the input. I will investigate this issue this week 👍
Author
Owner

@NghiaTranUIT commented on GitHub (May 23, 2022):

@Groovee60 what Networking library you're using on Android? Is it okhttp or retrofit or fast? 🤔

<!-- gh-comment-id:1134112020 --> @NghiaTranUIT commented on GitHub (May 23, 2022): @Groovee60 what Networking library you're using on Android? Is it okhttp or retrofit or fast? 🤔
Author
Owner

@Groovee60 commented on GitHub (May 23, 2022):

Retrofit 2.9.0

<!-- gh-comment-id:1134877602 --> @Groovee60 commented on GitHub (May 23, 2022): Retrofit 2.9.0
Author
Owner

@NghiaTranUIT commented on GitHub (May 30, 2022):

@Groovee60 @ekurdesov if you don't mind, please try this Beta build: https://proxyman.s3.us-east-2.amazonaws.com/beta/Proxyman_3.5.0_Fix_Duplicate_issue.dmg

Basically, when the connection is closed, Proxyman might incorrectly generate duplicated requests. Thus, it displays multiple requests.

Let me know if it fixes for you 👍

<!-- gh-comment-id:1140934755 --> @NghiaTranUIT commented on GitHub (May 30, 2022): @Groovee60 @ekurdesov if you don't mind, please try this Beta build: https://proxyman.s3.us-east-2.amazonaws.com/beta/Proxyman_3.5.0_Fix_Duplicate_issue.dmg Basically, when the connection is closed, Proxyman might incorrectly generate duplicated requests. Thus, it displays multiple requests. Let me know if it fixes for you 👍
Author
Owner

@Groovee60 commented on GitHub (May 31, 2022):

Hello - I'm sorry to report that I am still seeing the same failure - three entries for an API endpoint after invoking it only once.
.

<!-- gh-comment-id:1142400954 --> @Groovee60 commented on GitHub (May 31, 2022): Hello - I'm sorry to report that I am still seeing the same failure - three entries for an API endpoint after invoking it only once. .
Author
Owner

@Groovee60 commented on GitHub (May 31, 2022):

Screen Shot 2022-05-31 at 10 14 11 AM

<!-- gh-comment-id:1142403039 --> @Groovee60 commented on GitHub (May 31, 2022): ![Screen Shot 2022-05-31 at 10 14 11 AM](https://user-images.githubusercontent.com/7211332/171234238-98daab9d-74bd-497d-aaf9-f46aa667a979.png)
Author
Owner

@NghiaTranUIT commented on GitHub (Jun 1, 2022):

@Groovee60 It seems they are 3 separate requests, doesn't it? You can see they both have the Response Size, not zero bytes.

Just a side question: Do you have an app on PlayStore that I can install to my Emulator for testing?

<!-- gh-comment-id:1143026711 --> @NghiaTranUIT commented on GitHub (Jun 1, 2022): @Groovee60 It seems they are 3 separate requests, doesn't it? You can see they both have the Response Size, not zero bytes. Just a side question: Do you have an app on PlayStore that I can install to my Emulator for testing?
Author
Owner

@Groovee60 commented on GitHub (Jun 1, 2022):

I'm afraid we don't have an app on the PlayStore, it is an internal app. My logging shows that the API call is only being made once. At first I assumed it was some unexpected/misunderstood behavior of Retrofit, but I gave up on that theory when 1) it didn't happen with Charles as the web proxy and 2) it only happened after clearing the Proxyman window.

<!-- gh-comment-id:1143108268 --> @Groovee60 commented on GitHub (Jun 1, 2022): I'm afraid we don't have an app on the PlayStore, it is an internal app. My logging shows that the API call is only being made once. At first I assumed it was some unexpected/misunderstood behavior of Retrofit, but I gave up on that theory when 1) it didn't happen with Charles as the web proxy and 2) it only happened after clearing the Proxyman window.
Author
Owner

@NghiaTranUIT commented on GitHub (Jun 1, 2022):

Good news @Groovee60 @ekurdesov 🙌, I'm able to reproduce your issue, and here is the fix: https://proxyman.s3.us-east-2.amazonaws.com/beta/Proxyman_3.5.1_Fix_duplicate_request_after_clearing_the_session.dmg

Basically, after we click on the Clear Session button, Proxyman will close all Swift NIO Channels. However, it's an async process. Thus, some requests might be added to the pool.

The fix makes sure that it properly closes the channel.

Not sure why it only happens on Android apps, and it works fine for iOS apps.

<!-- gh-comment-id:1143365413 --> @NghiaTranUIT commented on GitHub (Jun 1, 2022): Good news @Groovee60 @ekurdesov 🙌, I'm able to reproduce your issue, and here is the fix: https://proxyman.s3.us-east-2.amazonaws.com/beta/Proxyman_3.5.1_Fix_duplicate_request_after_clearing_the_session.dmg Basically, after we click on the Clear Session button, Proxyman will close all Swift NIO Channels. However, it's an async process. Thus, some requests might be added to the pool. The fix makes sure that it properly closes the channel. Not sure why it only happens on Android apps, and it works fine for iOS apps.
Author
Owner

@Groovee60 commented on GitHub (Jun 1, 2022):

Looks like you nailed it - thanks!!!

<!-- gh-comment-id:1143922709 --> @Groovee60 commented on GitHub (Jun 1, 2022): Looks like you nailed it - thanks!!!
Author
Owner

@NghiaTranUIT commented on GitHub (Jun 2, 2022):

Thanks. I have 1 customer that confirmed this issue is fixed on their side too. I'm going to release a hotfit today 👍

<!-- gh-comment-id:1144321137 --> @NghiaTranUIT commented on GitHub (Jun 2, 2022): Thanks. I have 1 customer that confirmed this issue is fixed on their side too. I'm going to release a hotfit today 👍
Author
Owner

@NghiaTranUIT commented on GitHub (Jun 2, 2022):

@Groovee60 I've released this fix on Proxyman 3.5.2, please update it 👍

Thanks guys for helping me to solve this case 😄

<!-- gh-comment-id:1144837505 --> @NghiaTranUIT commented on GitHub (Jun 2, 2022): @Groovee60 I've released this fix on Proxyman 3.5.2, please update it 👍 Thanks guys for helping me to solve this case 😄
Author
Owner

@adamdahan commented on GitHub (Jan 21, 2023):

This is still a problem with iOS

<!-- gh-comment-id:1399334205 --> @adamdahan commented on GitHub (Jan 21, 2023): This is still a problem with iOS
Author
Owner

@adamdahan commented on GitHub (Jan 21, 2023):

I see 4 requests for each 1 request in my iOS app

<!-- gh-comment-id:1399334221 --> @adamdahan commented on GitHub (Jan 21, 2023): I see 4 requests for each 1 request in my iOS app
Author
Owner

@NghiaTranUIT commented on GitHub (Jan 22, 2023):

Hi @adamdahan you means the Proxyman for iOS app? If it's, what version you're using 🤔

<!-- gh-comment-id:1399384619 --> @NghiaTranUIT commented on GitHub (Jan 22, 2023): Hi @adamdahan you means the Proxyman for iOS app? If it's, what version you're using 🤔
Author
Owner

@adamdahan commented on GitHub (Jan 22, 2023):

@NghiaTranUIT this is in the proxyman app. I can tail my server logs and see only a single request but in proxyman app for mac version 4.0.0 you see 4 x the amount of requests for every single endpoint. It's actually what made me stop using the app entirely. It's a lovely product but seems there are some core issues that need some TLC.

<!-- gh-comment-id:1399569006 --> @adamdahan commented on GitHub (Jan 22, 2023): @NghiaTranUIT this is in the proxyman app. I can tail my server logs and see only a single request but in proxyman app for mac version 4.0.0 you see 4 x the amount of requests for every single endpoint. It's actually what made me stop using the app entirely. It's a lovely product but seems there are some core issues that need some TLC.
Author
Owner

@adamdahan commented on GitHub (Jan 22, 2023):

The Traffic.Package has different UUID for same requests as well.

<!-- gh-comment-id:1399569103 --> @adamdahan commented on GitHub (Jan 22, 2023): The Traffic.Package has different UUID for same requests as well.
Author
Owner

@NghiaTranUIT commented on GitHub (Jan 23, 2023):

@adamdahan not sure what the "Traffic.Package" is?

Can you share with me the name of your iOS app on AppStore? I'd like to download and investigate the bug.

<!-- gh-comment-id:1399681375 --> @NghiaTranUIT commented on GitHub (Jan 23, 2023): @adamdahan not sure what the "Traffic.Package" is? Can you share with me the name of your iOS app on AppStore? I'd like to download and investigate the bug.
Author
Owner

@adamdahan commented on GitHub (Jan 23, 2023):

🤔 TrafficPackage is literally the class in Atlantis that represents an intercepted http request. https://github.com/ProxymanApp/atlantis/blob/main/Sources/Packages.swift

<!-- gh-comment-id:1399766537 --> @adamdahan commented on GitHub (Jan 23, 2023): 🤔 TrafficPackage is literally the class in Atlantis that represents an intercepted http request. `https://github.com/ProxymanApp/atlantis/blob/main/Sources/Packages.swift`
Author
Owner

@adamdahan commented on GitHub (Jan 23, 2023):

And you can use any app, the proxyman app shows multiple requests for any http request. My app isn't special.

<!-- gh-comment-id:1399767527 --> @adamdahan commented on GitHub (Jan 23, 2023): And you can use any app, the proxyman app shows multiple requests for any http request. My app isn't special.
Author
Owner

@NghiaTranUIT commented on GitHub (Jan 23, 2023):

Thanks. I'd like to verify @adamdahan

  • You're using the Atlantis framework on your iOS app. Make sure to use the latest Atlantis version 1.20.0
  • Proxyman for macOS 4.0.0
  • Your iOS app is running on iOS 16

and you see multiple requests for a single request.

Is it correct? Sorry due to lack of information.

<!-- gh-comment-id:1399785418 --> @NghiaTranUIT commented on GitHub (Jan 23, 2023): Thanks. I'd like to verify @adamdahan - You're using the Atlantis framework on your iOS app. Make sure to use the latest Atlantis version 1.20.0 - Proxyman for macOS 4.0.0 - Your iOS app is running on iOS 16 and you see multiple requests for a single request. Is it correct? Sorry due to lack of information.
Author
Owner

@adamdahan commented on GitHub (Jan 23, 2023):

  • iOS 16,
  • pod atlantis-proxyman (no version specified)
  • Proxyman for macOS 4.0.0

And I see multiple requests for every request, whether it be from my app or third party sdk like snapchat / firebase etc...

<!-- gh-comment-id:1399787078 --> @adamdahan commented on GitHub (Jan 23, 2023): - iOS 16, - pod atlantis-proxyman (no version specified) - Proxyman for macOS 4.0.0 And I see multiple requests for every request, whether it be from my app or third party sdk like snapchat / firebase etc...
Author
Owner

@adamdahan commented on GitHub (Jan 23, 2023):

Sometimes filter by 2xx will clean the requests so it only shows 1. But this is only once in a while. Usually 4x per request.

<!-- gh-comment-id:1399787749 --> @adamdahan commented on GitHub (Jan 23, 2023): Sometimes filter by 2xx will clean the requests so it only shows 1. But this is only once in a while. Usually 4x per request.
Author
Owner

@NghiaTranUIT commented on GitHub (Jan 23, 2023):

@adamdahan Sorry but I could not find a reliable way to reproduce your issue. Here is what I've tried:

  1. Use Alamofire example app for iOS 16 iPhone
  2. Add Atlantis 1.2.0.0 via CocoaPod
  3. Add FirebaseCore and FirebaseAnalytic (to mimic your setup)
  4. Use Proxyman for macOS v4.0.0

Result

  • Could not reproduce the duplicated issue
  • 1 Alamofire Request -> 1 request on the app
Screenshot 2023-01-23 at 19 55 41

If you don't mind @adamdahan , please open the Podfile.lock and share with me the Atlantis version? If it's not the latest version, please update it. I remember that this duplicated was fixed in the latest Atlantis build.

<!-- gh-comment-id:1400412938 --> @NghiaTranUIT commented on GitHub (Jan 23, 2023): @adamdahan Sorry but I could not find a reliable way to reproduce your issue. Here is what I've tried: 1. Use Alamofire example app for iOS 16 iPhone 2. Add Atlantis 1.2.0.0 via CocoaPod 3. Add FirebaseCore and FirebaseAnalytic (to mimic your setup) 4. Use Proxyman for macOS v4.0.0 **Result** - Could not reproduce the duplicated issue - 1 Alamofire Request -> 1 request on the app <img width="1668" alt="Screenshot 2023-01-23 at 19 55 41" src="https://user-images.githubusercontent.com/5878421/214059783-cd1f8997-0aae-46fe-a900-aecad7d594b1.png"> ------------- If you don't mind @adamdahan , please open the Podfile.lock and share with me the Atlantis version? If it's not the latest version, please update it. I remember that this duplicated was fixed in the latest Atlantis build.
Author
Owner

@adamdahan commented on GitHub (Jan 23, 2023):

Oh you know what - this is using an older version of atlantis, Podfile.lock:
- atlantis-proxyman (1.18.2)

<!-- gh-comment-id:1400621838 --> @adamdahan commented on GitHub (Jan 23, 2023): Oh you know what - this is using an older version of atlantis, Podfile.lock: ` - atlantis-proxyman (1.18.2)`
Author
Owner

@adamdahan commented on GitHub (Jan 23, 2023):

Let me upgrade to the latest and test again - I will report back - if I find issue I will upload a video for you to see. Keep you posted.

<!-- gh-comment-id:1400622661 --> @adamdahan commented on GitHub (Jan 23, 2023): Let me upgrade to the latest and test again - I will report back - if I find issue I will upload a video for you to see. Keep you posted.
Author
Owner

@adamdahan commented on GitHub (Jan 23, 2023):

Bug still persists. See image below running Proxyman 4.0.0, Atlantis 1.20.0, iOS 16:

[TERMINAL] - Dev server showing a single POST request transmitted /ratings
[PROXYMAN] - Showing 4 API requests.

Screen Shot 2023-01-23 at 11 35 34 AM
<!-- gh-comment-id:1400644428 --> @adamdahan commented on GitHub (Jan 23, 2023): Bug still persists. See image below running Proxyman 4.0.0, Atlantis 1.20.0, iOS 16: [TERMINAL] - Dev server showing a single POST request transmitted `/ratings` [PROXYMAN] - Showing 4 API requests. <img width="1727" alt="Screen Shot 2023-01-23 at 11 35 34 AM" src="https://user-images.githubusercontent.com/1205894/214096342-395c902a-a061-4b13-9e0f-0a6d652c8fc0.png">
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/Proxyman#1237
No description provided.