-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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(app-check, ios): remove import loop to fix protocol def warning #8133
fix(app-check, ios): remove import loop to fix protocol def warning #8133
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
import loops can apparently be the root cause of protocol definition issues, and if you ensure imports only happen once by chaining correctly then protocol definitions are found correctly and the warning goes away
5a81ae4
to
e07cd2c
Compare
Yes! Finally nailed this compile warning - it's the last one that was left in the react-native-firebase apple native code after previous fixes |
@@ -16,10 +16,7 @@ | |||
*/ | |||
|
|||
#import "RNFBAppCheckProviderFactory.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this one imports RNFBAppCheckProvider.h, which imports the others, including them again below caused the loop which caused the warning
@@ -15,7 +15,7 @@ | |||
* | |||
*/ | |||
|
|||
#import <FirebaseAppCheck/FIRAppCheck.h> | |||
#import "RNFBAppCheckProvider.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
including FIRAppCheck here also contributed to the loop, so instead chain to the "parent" header file, and it includes all the others but this way they are included once-and-only-once
@@ -16,13 +16,13 @@ | |||
*/ | |||
|
|||
#import <Firebase/Firebase.h> | |||
#import <FirebaseAppCheck/FIRAppCheck.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this was just a style change from ""
style imports to <>
Description
Import loops can apparently be the root cause of protocol definition issues, and if you ensure imports only happen once by chaining correctly then protocol definitions are found correctly and the warning goes away
This warning:
Has been present since I originally implemented this feature to glue together the native SDK app check init process into something that looked like the firebase-js-sdk style, and I couldn't figure it out at the time
While reviewing another PR I saw this again though and it bothered me so I took another look at it. Stackoverflow provided the guidance that import loops can cause this unhelpful error and sure enough cleaning up the imports so they are singular in all cases appears to have fixed it
Related issues
Release Summary
conventional commit so merge+rebase will work
Checklist
Android
iOS
e2e
tests added or updated inpackages/\*\*/e2e
jest
tests added or updated inpackages/\*\*/__tests__
Test Plan
If app check still builds+works in CI at all this works, because this object is used in testing and it will work completely or break completely with this change
Think
react-native-firebase
is great? Please consider supporting the project with any of the below:React Native Firebase
andInvertase
on Twitter