Skip to content

fix(auth, expo): lowercase String? in swift using .lowercased() #8507

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

Merged
merged 1 commit into from
May 3, 2025

Conversation

f5io
Copy link
Contributor

@f5io f5io commented May 1, 2025

Description

We currently have some javascript code being added via the new swift-based plugin. This simply fixes the swift code.

❌  (ios/Gizmo/AppDelegate.swift:46:17)

  44 |   ) -> Bool {
  45 | // @generated begin @react-native-firebase/auth-openURL - expo prebuild (DO NOT MODIFY)
> 46 |     if url.host.toLowerCase() == "firebaseauth" {
     |                 ^ value of type 'String?' has no member 'toLowerCase'
  47 |       // invocations for Firebase Auth are handled elsewhere and should not be forwarded to Expo Router
  48 |       return false
  49 |     }

Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
    • Yes
  • My change supports the following platforms;
    • Android
    • iOS
    • Other (macOS, web)
  • 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

I have yet to run the tests locally, is there an easy way to just run the auth package plugin's tests?


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

Copy link

vercel bot commented May 1, 2025

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 May 1, 2025 7:09pm

@CLAassistant
Copy link

CLAassistant commented May 1, 2025

CLA assistant check
All committers have signed the CLA.

@f5io f5io changed the title fix(auth, ios): lowercase String? in swift using .lowercased() fix(auth): lowercase String? in swift using .lowercased() May 1, 2025
Copy link
Collaborator

@mikehardy mikehardy left a comment

Choose a reason for hiding this comment

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

Looks reasonable - is this backwards/forwards compatible with older/newer swift versions? Just curious why this is breaking now but not before.
I suppose if we're requiring Xcode 16.2+ now then if they changed the nullability and it affects everyone on Xcode 16.2+ that's just a bugfix vs a potentially breaking change, so it won't work on Xcode < 16.2 anyway...

@mikehardy
Copy link
Collaborator

I couldn't get the CI to kick off again, so I pulled this locally, squashed the two commits to one fix(auth, expo) one, and force-pushed, please forgive me. CI should should go green now though and I'll by happy to merge this once I understand the compatibility implications. I appreciate the fix. Cheers

@f5io
Copy link
Contributor Author

f5io commented May 1, 2025

Looks reasonable - is this backwards/forwards compatible with older/newer swift versions? Just curious why this is breaking now but not before. I suppose if we're requiring Xcode 16.2+ now then if they changed the nullability and it affects everyone on Xcode 16.2+ that's just a bugfix vs a potentially breaking change, so it won't work on Xcode < 16.2 anyway...

Looks like this was added in this PR, but its just completely invalid swift code. It looks like the author got confused with JS toLowerCase() vs swift's lowercased() method.

I was having trouble running an eas build and this patch got me through the build with no issues.

@f5io f5io changed the title fix(auth): lowercase String? in swift using .lowercased() fix(auth, expo): lowercase String? in swift using .lowercased() May 1, 2025
@sainijagjit
Copy link

Screenshot 2025-05-03 at 4 49 59 PM

I am facing a similar issue

"@react-native-firebase/app": "^22.1.0"
"@react-native-firebase/auth": "^22.1.0"
"@react-native-firebase/crashlytics": "^22.1.0"

@mikehardy mikehardy merged commit af435e8 into invertase:main May 3, 2025
15 of 17 checks passed
@mikehardy mikehardy removed Workflow: Waiting for User Response Blocked waiting for user response. Workflow: Pending Merge Waiting on CI or similar Needs Attention labels May 3, 2025
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.

4 participants