AckeeCZ / Reqres

Simple network activity logger for iOS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

duplicate http request

murad1981 opened this issue · comments

using the example target, I noticed that when calling alamofileManager.request in ViewController.swift actually makes 2 requests for the same url, because Reqres.swift also makes a request inside the startLoading method, I caught up this issue using XCode 13's Network instrument.

Hi @murad1981, thanks for being interested in Reqres! 😎

We identified the issue of sending new request from startLoading(...) a while ago and reconsidered Reqres purpose to be primarily debug tool and should rather not be used in production apps, which might be better communicated in README and probably even in console when running with Reqres configured.

Regarding the issue it self - looks like the Network instrument is catching requests that are "ordered" to be sent and not those that are actually sent. Although it might be inconvenient, it would probably be better not to use Reqres even when using Network instrument as Reqres is redundant and much less capable compared to Network instrument.

Just for investigation purposes I linked the example app to RequestBin just to make sure that really only a single request leaves the device which seems to work fine.

So as a result of this issue I will create another task, that will cover adding the debug purpose of Reqres to README and to the console (#34) and another task to make clear that sending new request from startLoading(...) is known issue and because of that it should rather not be used in production (#33).

Agree?

yeah ... that's totally fine ... thank you for the effort