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

test: bump e2e test runner to React Native 0.74.1 #7985

Merged
merged 20 commits into from
Sep 2, 2024

Conversation

russellwheatley
Copy link
Member

@russellwheatley russellwheatley commented Aug 20, 2024

Description

  • Moved test app to React Native 0.74.1.

Fixes required for react-native-macos

  • Patch package required to add this fix back. It was reverted in this PR which is part of React Native 0.74.1. Required for test runner for Firebase Storage macOS as we use ArrayBuffer here.
  • Firebase Storage macOS implementation needed fixing up as well, not related to update 0.74.1.

We're skipping StorageReference tests on macOS. It is fragile because of uploadBytesResumable(). Attempted multiple ways of encoding data (Blob, Uint8Array & ArrayBuffer) but to no avail. This issue is roughly what is happening.

To be specific, it is the way that uploadBytesResumable() interacts with React Native. There is an incompatibility issue with the way the upload request is handled when specifically uploading buffers/blobs. Using a Blob results in a crash 100% of the time, using ArrayBuffer is more stable but still crashes from time to time. Even worse is that the resulting string is encoded in base64 in the text file created.

On web, this code results in a text file with correct content (i.e. "hello world"):

const storageRef = ref(storage, 'test.txt');
const encoder = new TextEncoder();
const blob = encoder.encode('hello world').buffer;

await  uploadBytesResumable(storageRef, blob);

On react native, it is base64 encoded, even with "text/plain" content type.

Worth keeping an eye on React Native for ArrayBuffer implementation. See: facebook/react-native#41170

Related issues

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


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

Copy link

vercel bot commented Aug 20, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-native-firebase ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 29, 2024 10:35am

@russellwheatley russellwheatley marked this pull request as draft August 20, 2024 12:21
@russellwheatley russellwheatley changed the title test: make RN + RN macOS same version (0.74.1) test: bump e2e test runner to React Native 0.74.1 Aug 20, 2024
@russellwheatley russellwheatley changed the title test: bump e2e test runner to React Native 0.74.1 test: bump e2e test runner to React Native 0.74.1 Aug 20, 2024
Lyokone
Lyokone previously approved these changes Sep 2, 2024
@Lyokone Lyokone dismissed their stale review September 2, 2024 08:08

Pr not ready

@russellwheatley russellwheatley merged commit bcaa464 into main Sep 2, 2024
20 checks passed
@russellwheatley russellwheatley deleted the react-native-0.74 branch September 2, 2024 13:39
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.

3 participants