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

feat(storage): support storage.useEmulator, and md5hash metadata on upload #5324

Merged
merged 4 commits into from
May 19, 2021

Conversation

mikehardy
Copy link
Collaborator

@mikehardy mikehardy commented May 17, 2021

Description

Each commit has it's own informative title and notes

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

Turn off your network and run e2e tests with the storage emulator running or
turn off the emulator and try to run e2e tests

Right now those show Android and iOS is using the emulator and it's all working

There are a few platform-specific issues marked FIXME, that need followup with firebase repos

  • metadata issues
  • permission issues

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

@vercel
Copy link

vercel bot commented May 17, 2021

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/BBTfbY8Uu6KGNKKnF8NofJwKpbWD
✅ Preview: https://react-native-f-git-mikehardy-storage-useemulator-in-05e686.vercel.app

@mikehardy mikehardy requested a review from Salakar May 17, 2021 06:20
@codecov
Copy link

codecov bot commented May 17, 2021

Codecov Report

Merging #5324 (94f6836) into master (95cdec6) will increase coverage by 6.18%.
The diff coverage is 91.67%.

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

@@             Coverage Diff              @@
##             master    #5324      +/-   ##
============================================
+ Coverage     68.38%   74.56%   +6.18%     
============================================
  Files           189       97      -92     
  Lines          9449     4288    -5161     
  Branches       1411      921     -490     
============================================
- Hits           6461     3197    -3264     
+ Misses         2569     1021    -1548     
+ Partials        419       70     -349     

@mikehardy
Copy link
Collaborator Author

@Salakar not sure what's going on with iOS, it seems like such a simple call but then when you go to fetch references and do things, it tries to go to live storage.

Does it need to be more like functions where at the javascript level we keep track of the emulator host/port and rewrite everything between gs:// and the bucket name before sending it native?

@mikehardy mikehardy force-pushed the @mikehardy/storage-useEmulator branch from 437cc2f to b04718a Compare May 19, 2021 06:31
@mikehardy mikehardy force-pushed the @mikehardy/storage-useEmulator branch from b04718a to ecb6aee Compare May 19, 2021 07:02
@mikehardy mikehardy changed the title feat(storage, emulator): storage emulator, and various storage fixes, WIP iOS not working feat(storage): support storage.useEmulator, and md5hash metadata on upload May 19, 2021
@mikehardy mikehardy added the Workflow: Pending Merge Waiting on CI or similar label May 19, 2021
mikehardy added 4 commits May 19, 2021 02:46
…roid 10/11 compat

On Android the following paths exist in app.utils.paths but are inaccessible without special permission:
  'EXTERNAL_DIRECTORY',
  'EXTERNAL_STORAGE_DIRECTORY',
  'PICTURES_DIRECTORY',
  'MOVIES_DIRECTORY',

Please follow Google's migration guides for "Scoped Storage" to store your data in a future compatible way.
https://developer.android.com/about/versions/11/privacy/storage#scoped-storage

BREAKING CHANGE: if you need READ_EXTERNAL_STORAGE/WRITE_EXTERNAL_STORAGE permission add them in your app AndroidManifest.xml
metadata property md5hash is allowed for upload, just not for updateMetadata
allow it to go through in the putNNN scenarios but screen for it on update
@mikehardy mikehardy force-pushed the @mikehardy/storage-useEmulator branch from ecb6aee to b6f6fae Compare May 19, 2021 07:46
@mikehardy mikehardy removed the Workflow: Pending Merge Waiting on CI or similar label May 19, 2021
@mikehardy mikehardy merged commit be1bed8 into master May 19, 2021
@mikehardy mikehardy deleted the @mikehardy/storage-useEmulator branch May 19, 2021 07:48
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.

1 participant