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

fix(ios, storage): handle nil file extension from ios14 M1 emulators #4676

Merged
merged 1 commit into from
Dec 18, 2020

Conversation

Maxoos
Copy link
Contributor

@Maxoos Maxoos commented Dec 15, 2020

Description

This fix resolves a crash that occurs when pathExtension returns NULL, failing to detect file extension. This was detected as a result of a simulator bug with Apple Silicon Macs where pathExtension returns NULL only iOS14 (works as expected on iOS13).

This bug would probably surface on any device if file extension could not be detected when calling mimeTypeForPath, this could be used to verify the fix on intel Macs.

Related issues

Fixes #4661

Release Summary

Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
    • Yes
  • My change supports the following platforms;
    • Android
    • iOS
  • My change includes tests;
    • e2e tests added or updated in packages/\*\*/e2e
    • jest tests added or updated in packages/\*\*/__tests__
  • I have updated TypeScript types that are affected by my change.
  • This is a breaking change;
    • Yes
    • No

Test Plan

Verified mimeTypeForPath function on Apple Silicon with iOS14 sim to return @"application/octet-stream". Verified CFRelease is being called on iOS13 sim.


Think react-native-firebase is great? Please consider supporting the project with any of the below:

@vercel
Copy link

vercel bot commented Dec 15, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/invertase/react-native-firebase/lhk34oyur
✅ Preview: https://react-native-firebase-git-maxoos-patch-1.invertase.vercel.app

@CLAassistant
Copy link

CLAassistant commented Dec 15, 2020

CLA assistant check
All committers have signed the CLA.

@mikehardy mikehardy changed the title Fix crash when trying to release NULL value fix(ios, storage): handle nil file extension from ios14 M1 emulators Dec 15, 2020
@mikehardy
Copy link
Collaborator

Thanks @Maxoos - it looks like the CLA still isn't signed? If you can sign that I can work this through the QA process and merge it

@mikehardy
Copy link
Collaborator

Hi @Maxoos ! Unfortunately without the CLA signed (you can follow the instructions above or click the 'details' link on the license/cla check) we cannot merge this and I will have to close it

@Maxoos
Copy link
Contributor Author

Maxoos commented Dec 17, 2020

Sorry @mikehardy was a bit full on before the holidays. Should be all sorted now!

@codecov
Copy link

codecov bot commented Dec 17, 2020

Codecov Report

Merging #4676 (72e961f) into master (50ecf38) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #4676   +/-   ##
=======================================
  Coverage   89.09%   89.09%           
=======================================
  Files         109      109           
  Lines        3712     3712           
  Branches      347      347           
=======================================
  Hits         3307     3307           
  Misses        363      363           
  Partials       42       42           

@mikehardy mikehardy added Workflow: Pending Merge Waiting on CI or similar and removed Workflow: Needs Review Pending feedback or review from a maintainer. labels Dec 18, 2020
@mikehardy mikehardy merged commit e1eb992 into invertase:master Dec 18, 2020
@mikehardy mikehardy removed the Workflow: Pending Merge Waiting on CI or similar label Dec 18, 2020
@Maxoos Maxoos deleted the Maxoos-patch-1 branch December 18, 2020 03:44
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.

[Crash] putFile will crash when extension in unknown
3 participants