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

[iOS] Multiple request handler error when trying to show an image #16159

Closed
tsjamm opened this Issue Oct 1, 2017 · 1 comment

Comments

Projects
None yet
1 participant
@tsjamm
Contributor

tsjamm commented Oct 1, 2017

Is this a bug report?

Yes

Have you read the Contributing Guidelines?

Yes

Environment

Environment:
OS: macOS Sierra 10.12.6
Node: 6.11.2
Yarn: Not Found
npm: 3.10.10
Watchman: 4.6.0
Xcode: Xcode 9.0 Build version 9A235
Android Studio: 2.3 AI-162.4069837

Packages: (wanted => installed)
react: 16.0.0-alpha.12 => 16.0.0-alpha.12
react-native: 0.48.4 => 0.48.4

Target Platform: iOS (11)

Issue

simulator screen shot - iphone 6s - 2017-10-01 at 19 56 15

RCTImageStoreManager and RCTBlobManager both have a priority of 0.

I sat debugging in XCode and printed the following list of handlers and their corresponding priorities in the function handlerForRequest in RCTNetworking.mm

<RCTImageLoader: 0x6040000f1680>
Priority=1.000000
<RCTImageStoreManager: 0x604000238120>
Priority=0.000000
<RCTBlobManager: 0x60000025d760>
Priority=0.000000
<RCTFileRequestHandler: 0x60400000d2f0>
Priority=0.000000
<RCTDataRequestHandler: 0x60400000d360>
Priority=0.000000
<RCTHTTPRequestHandler: 0x6040000ab760>
Priority=0.000000

I am assuming the priority should be given to the ImageStoreManager over the BlobManager.
This further implies that ImageLoader's Priority should be higher.

When I went and manually changed the priorities, it seemed to not crash, but not sure if this is the right fix.

<RCTImageLoader: 0x6040000f1680>
Priority=2.000000
<RCTImageStoreManager: 0x604000238120>
Priority=1.000000
<RCTBlobManager: 0x60000025d760>
Priority=0.000000
<RCTFileRequestHandler: 0x60400000d2f0>
Priority=0.000000
<RCTDataRequestHandler: 0x60400000d360>
Priority=0.000000
<RCTHTTPRequestHandler: 0x6040000ab760>
Priority=0.000000

This issue had been faced by others in the closed issue: 9031
#9031 (comment)

For more context, I was using HTMLView from the react-native-htmlview npm package
https://www.npmjs.com/package/react-native-htmlview
and happens when I load html fetched from a server, which contains an image tag with this source. I'm not sure if this issue is specific to HTMLView but seems more like a ReactNative issue, so posting here. Let me know if you think otherwise, or need more information

tsjamm added a commit to tsjamm/react-native that referenced this issue Oct 1, 2017

Issue facebook#16159 - RCTImageStoreManager's priority
Summary: RCTImageStoreManager and RCTBlobManager have the same priority, hence in certain cases, both are able to handle the request, but this causes non-deterministic behavior. Hence increased ImageStoreManager's Priority to 1 and thereby increasing RCTImageLoader's Priority to 2 to prevent similar issue of same priorities.

facebook-github-bot added a commit that referenced this issue Oct 10, 2017

Issue #16159 - RCTImageStoreManager's priority
Summary:
RCTImageStoreManager and RCTBlobManager have the same priority, hence in certain cases, both are able to handle the request, but this causes non-deterministic behavior. Hence increased ImageStoreManager's Priority to 1 and thereby increasing RCTImageLoader's Priority to 2 to prevent similar issue of same priorities.

Issue: #16159
Closes #16160

Differential Revision: D6017931

Pulled By: shergin

fbshipit-source-id: 91f2737af4f2f97197734b696105e1cdc5683365
@stale

This comment has been minimized.

Show comment
Hide comment
@stale

stale bot Nov 30, 2017

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. If you think this issue should definitely remain open, please let us know why. Thank you for your contributions.

stale bot commented Nov 30, 2017

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. If you think this issue should definitely remain open, please let us know why. Thank you for your contributions.

@stale stale bot added the Stale label Nov 30, 2017

@stale stale bot closed this Dec 7, 2017

@facebook facebook locked and limited conversation to collaborators May 15, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.