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

Duplicate Requests Question #71

Open
i3i2uno opened this issue Nov 9, 2023 · 0 comments
Open

Duplicate Requests Question #71

i3i2uno opened this issue Nov 9, 2023 · 0 comments

Comments

@i3i2uno
Copy link

i3i2uno commented Nov 9, 2023

Describe the bug
This is more a question then a bug, but I have noticed that when a track is loaded, there is a duplicate request made to the url provided. I don't really think this is a bug within SwiftAudioEx as much as its just the way things work within the AVAudio system because this issue is not unique to SwiftAudioEx but also exists in a number of other libraries that I have tried, that use the same iOS libraries such as AVUrlAsset and AVPlayer, but I am hoping to receive some guidance on if this issue is avoidable in any way.

To Reproduce
Just load a track into QueuedAudioPlayer. You will notice in any network logger that two requests are made to the url as shown in the screenshot.

Expected behavior
That only one request will occur for the given url.

Screenshots
image
image

Additional context
The first of the requests seems to come from the AVURLAsset method, which you would expect, but then it seems to be hit again when the replaceCurrentItem method is fired. As mentioned, I am not sure that there is really a way to prevent this as this seems to be the correct way to load a remote object into the AVPlayer, as I have noticed the same order of operations on a number of other iOS libraries that load a remote object into the AVPlayer and I do indeed see the duplicate requests there as well. It does not cause any direct issues, it is only a problem for one of our clients that uses the request to capture analytics for how many times the endpoint is being hit, and this can potentially lead to double the actual number. And we may just have to fix it on the backend to ignore these "duplicate" requests, but I just wanted to check here to see if there was anything that we could do within the app/this library to prevent these duplicate requests?

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

1 participant