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

Don't use enumerateByteRangesUsingBlock #220

Merged
merged 1 commit into from
Jun 1, 2022

Conversation

gitrema
Copy link
Contributor

@gitrema gitrema commented May 31, 2022

This is basically a revert for
844112c

It is actually not clear how enumerateByteRangesUsingBlock can fix any
crash there but on the other hand is causing unnecessary callback and
delay in data delivering.

This is basically a revert for
spotify@844112c

It is actually not clear how enumerateByteRangesUsingBlock can fix any
crash there but on the other hand is causing unnecessary callback and
delay in data delivering.
@codecov
Copy link

codecov bot commented May 31, 2022

Codecov Report

Merging #220 (c7c64b6) into master (96adb9b) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

❗ Current head c7c64b6 differs from pull request most recent head c6f47b9. Consider uploading reports for the commit c6f47b9 to get more accurate results

@@            Coverage Diff             @@
##           master     #220      +/-   ##
==========================================
- Coverage   94.56%   94.55%   -0.02%     
==========================================
  Files          26       26              
  Lines        1325     1322       -3     
==========================================
- Hits         1253     1250       -3     
  Misses         72       72              
Flag Coverage Δ
ios 94.22% <ø> (-0.05%) ⬇️
macos 94.47% <100.00%> (-0.02%) ⬇️
tvos 94.22% <ø> (-0.05%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...es/SPTDataLoader/SPTDataLoaderRequestTaskHandler.m 98.97% <100.00%> (-0.04%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 96adb9b...c6f47b9. Read the comment docs.

@gitrema gitrema marked this pull request as ready for review May 31, 2022 16:15
@gitrema
Copy link
Contributor Author

gitrema commented May 31, 2022

@kmcbride @dflems would you mind to take a look at it?

@gitrema gitrema requested review from dflems and kmcbride May 31, 2022 16:16
@kmcbride
Copy link
Collaborator

I'm not familiar with the scenario that the original commit addressed, but it looks like Apple recommends using that approach: https://developer.apple.com/documentation/foundation/nsurlsessiondatadelegate/1411528-urlsession#discussion

@gitrema
Copy link
Contributor Author

gitrema commented May 31, 2022

thanks for the link I missed that recommendation. On the other hand if I get it correctly they are talking about when the bytes property on NSData is used and that is when you need to have access to the underlying memory directly. The method implementation does not have that requirement and either append the coming data in an NSMutableData object or pass them to the observer

@kmcbride
Copy link
Collaborator

kmcbride commented Jun 1, 2022

OK, good point — it should be left up to the delegate to enumerate the bytes if needed.

@gitrema gitrema merged commit f80263f into spotify:master Jun 1, 2022
@gitrema gitrema deleted the remove-enumeratebyranges branch June 1, 2022 11:19
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

Successfully merging this pull request may close these issues.

None yet

2 participants