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

[TM] Add spec for BlobModule #24909

Closed
wants to merge 3 commits into from

Conversation

ericlewis
Copy link
Contributor

Summary

Part of #24875. Not sure that the id’s types are necessarily correct here…

Changelog

[General] [Added] - Add TM spec for BlobModule

Test Plan

Flow passes

Not sure that the id’s types are necessarily correct here…
@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Contributor A React Native contributor. labels May 16, 2019
@react-native-bot react-native-bot added the Type: Enhancement A new feature or enhancement of an existing feature. label May 16, 2019
@ericlewis ericlewis added the Flow label May 16, 2019
Copy link
Contributor

@RSNara RSNara left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, but I think there's a mistake in the flow-typing.

Libraries/Blob/NativeBlobModule.js Outdated Show resolved Hide resolved
@ericlewis ericlewis requested a review from RSNara May 21, 2019 14:25
Copy link

@analysis-bot analysis-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code analysis results:

  • flow found some issues.

@@ -92,7 +92,7 @@ class BlobManager {
}
}, 0);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cannot call NativeBlobModule.createFromParts because property createFromParts is missing in null or undefined [1].

@@ -131,38 +131,38 @@ class BlobManager {
if (BlobRegistry.has(blobId)) {
return;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cannot call NativeBlobModule.release because property release is missing in null or undefined [1].

@@ -131,38 +131,38 @@ class BlobManager {
if (BlobRegistry.has(blobId)) {
return;
}
BlobModule.release(blobId);
NativeBlobModule.release(blobId);
}

/**
* Inject the blob content handler in the networking module to support blob
* requests and responses.
*/

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cannot call NativeBlobModule.addNetworkingHandler because property addNetworkingHandler is missing in null or undefined [1].

}

/**
* Inject the blob content handler in the networking module to support blob
* requests and responses.
*/
static addNetworkingHandler(): void {
BlobModule.addNetworkingHandler();
NativeBlobModule.addNetworkingHandler();
}

/**
* Indicate the websocket should return a blob for incoming binary
* messages.
*/

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cannot call NativeBlobModule.addWebSocketHandler because property addWebSocketHandler is missing in null or undefined [1].

}

/**
* Indicate the websocket should return a blob for incoming binary
* messages.
*/
static addWebSocketHandler(socketId: number): void {
BlobModule.addWebSocketHandler(socketId);
NativeBlobModule.addWebSocketHandler(socketId);
}

/**
* Indicate the websocket should no longer return a blob for incoming
* binary messages.
*/

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cannot call NativeBlobModule.removeWebSocketHandler because property removeWebSocketHandler is missing in null or undefined [1].

}

/**
* Indicate the websocket should no longer return a blob for incoming
* binary messages.
*/
static removeWebSocketHandler(socketId: number): void {
BlobModule.removeWebSocketHandler(socketId);
NativeBlobModule.removeWebSocketHandler(socketId);
}

/**
* Send a blob message to a websocket.
*/

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cannot call NativeBlobModule.sendOverSocket because property sendOverSocket is missing in null or undefined [1].

Copy link
Contributor

@RSNara RSNara left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! Thanks for the fixes.

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@RSNara has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@ericlewis
Copy link
Contributor Author

@RSNara flow is quite angry, i am attempting to fix

@react-native-bot
Copy link
Collaborator

This pull request was successfully merged by @ericlewis in 342c81d.

When will my fix make it into a release? | Upcoming Releases

@react-native-bot react-native-bot added the Merged This PR has been merged. label May 22, 2019
M-i-k-e-l pushed a commit to M-i-k-e-l/react-native that referenced this pull request Mar 10, 2020
Summary:
Part of facebook#24875. Not sure that the id’s types are necessarily correct here…

## Changelog

[General] [Added] - Add TM spec for BlobModule
Pull Request resolved: facebook#24909

Reviewed By: fkgozali

Differential Revision: D15433753

Pulled By: RSNara

fbshipit-source-id: 68193d1a82fc7c66d6cc7ba4f22a0d3786987599
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Contributor A React Native contributor. Flow Merged This PR has been merged. Native Module Type: Enhancement A new feature or enhancement of an existing feature.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants