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

Blob.slice Parameter contentType does not exists in iOS and Android. #38058

Closed
trashcoder opened this issue Jun 25, 2023 · 7 comments
Closed
Assignees

Comments

@trashcoder
Copy link
Contributor

Description

In react natives implementation of blob.slice the contentType parameter is missing:

https://developer.mozilla.org/en-US/docs/Web/API/Blob/slice

React Native Version

0.71.6

Output of npx react-native info

error: unknown command 'info'
(Did you mean init?)

Steps to reproduce

Open a new react native project and add a line with a blob.slice command. There is no contentType parameter. And so you will not see a value for .type on Android and iOS on a sliced blob. On React Native Web slicing works as expected.

Snack, code example, screenshot, or link to a repository

https://snack.expo.dev/kS7da4tSk

@github-actions
Copy link

⚠️ Newer Version of React Native is Available!
ℹ️ You are on a supported minor version, but it looks like there's a newer patch available - 0.71.11. Please upgrade to the highest patch for your minor or latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If it does not repro, please let us know so we can close out this issue. This helps us ensure we are looking at issues that still exist in the most recent releases.

@github-actions github-actions bot added Platform: Android Android applications. Platform: iOS iOS applications. labels Jun 25, 2023
@trashcoder
Copy link
Contributor Author

i upgraded to 0.71.11.
Within the class "Blob" the method "slice" still doesn't support the third parameter contentType.

@trashcoder
Copy link
Contributor Author

System:
OS: macOS 13.4
CPU: (8) arm64 Apple M1 Pro
Memory: 67.23 MB / 16.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 19.1.0 - ~/.nvm/versions/node/v19.1.0/bin/node
Yarn: 1.22.19 - ~/.nvm/versions/node/v19.1.0/bin/yarn
npm: 9.3.1 - ~/.nvm/versions/node/v19.1.0/bin/npm
Watchman: 2023.05.22.00 - /opt/homebrew/bin/watchman
Managers:
CocoaPods: 1.12.1 - /opt/homebrew/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 22.4, iOS 16.4, macOS 13.3, tvOS 16.4, watchOS 9.4
Android SDK: Not Found
IDEs:
Android Studio: Flamingo 2022.2.1 Patch 2 Flamingo 2022.2.1 Patch 2
Xcode: 14.3.1/14E300c - /usr/bin/xcodebuild
Languages:
Java: Not Found
npmPackages:
@react-native-community/cli: Not Found
react: 18.2.0 => 18.2.0
react-native: 0.71.11 => 0.71.11
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found

@blakef blakef self-assigned this Jun 26, 2023
@blakef
Copy link
Contributor

blakef commented Jun 26, 2023

I can confirm this.

Would you be interested in putting together a fix @trashcoder as a pull request? It looks reasonably straightforward between updating Blob#slice and adding a test to confirm the parameter is passed. I recon we could get this in today.

@trashcoder
Copy link
Contributor Author

I could try. But i never made a pull request before and i'm not familiar with the react-native code.

@github-actions github-actions bot added Needs: Attention Issues where the author has responded to feedback. and removed Needs: Author Feedback labels Jun 26, 2023
@cortinico cortinico removed the Needs: Attention Issues where the author has responded to feedback. label Jun 26, 2023
@trashcoder
Copy link
Contributor Author

ok, i made a change to the parameters. But i don't know how to test it.
How can i make "npx react-native init AwesomeProject" with my local react-native repo?

@blakef
Copy link
Contributor

blakef commented Jun 26, 2023

Great! You're not far off now, I'd recommend:

  • updating the unit test with your change to check that the Blob it generates has the correct type.
  • run the test locally to confirm it: yarn run test Blob-test.js
  • create a PR for us to review. You'll want to work through the contributing steps.

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 a pull request may close this issue.

3 participants