-
Notifications
You must be signed in to change notification settings - Fork 4k
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
🐛 [firebase_auth] Cannot use new Firebase Auth Emulator #3980
Comments
I've checked code briefly, and its using outdated native SDKs to support it. I am expecting that there is upcoming version bump, so can revisit later ;) |
This requires a SDK version updated, however some of the other plugins will break if we upgrade the BoM versions. There are potential workarounds we're looking into and have discussed. |
Discussed with whom and where? Is this a feature that's supported? If not, it makes worth noting in docs that Firebase Auth Emulator isn't supported in flutter yet. Thanks. update: Also, what is a "new emulator"? Have you created a new version of firebase emulator? |
@celesteking There is one emulator suite, it contains a new auth emulator. The auth emulator requires minimum firebase-ios-sdk version 7.0.0 (7.1.0 is current) and firebase-android-sdk 26.0.0 (26.1.0 is current as of now). You are likely aware Invertase is currently working hard on FlutterFire, with a crew of between 4-6 at any given time, and the discussions are internal because there is a mountain of work to do - prioritizing it and scheduling it is the same as in any other work project. Looks to me like the docs are open source, you could PR a note to them at any time? https://github.com/FirebaseExtended/flutterfire/tree/master/docs/auth I'm going to be doing a quick sizing exercise on fastest path towards an upgrade to the underlying SDKs starting shortly now that I've finished doing the same for react-native-firebase (invertase/react-native-firebase#4471) and if it's possible quickly then I'll add auth emulator support similar to the same I just released over there (invertase/react-native-firebase#4552) Hopefully it's quick work but I'm not sure of the size of forward port so it's hard to say. We'll be sure to keep this issue updated though! |
any news on auth emulator support? |
Yes, it "works"! :-), #4263 (you can follow along there) but it's a breaking change to forward port, which is something that needs to be done at a measured pace with great documentation and planning Plus the 2 PRs that take the repo through the breaking change and to the auth emulator support are still very rough. But it is open source, anyone can use my branch. There are only a few key commits that do the forward port (ML items, RemoteConfig, and one Messaging item if I recall correctly) so it's not that large a change really. |
Using remote auth with local firestore/cloud functions emulators works, if that's what you mean? |
Well, not sure on the depth and breadth of the tests in question, but at least from a maintainer perspective where we are frequently doing full CI runs against the same firebase project, we run into Auth API call rate limiting that flakes our CI frequently. Plus it's not nearly as fast - so I do see the need and for some projects it is a fairly serious one, but until the work is done, having an "isCI()" type flag and/or only running specific auth tests manually against the real APIs is the way to go. Another consideration is that perhaps through no fault of the developer they do not have a test project with separate data to run against, and running tests against production data is not allowed. |
@braamgenis thank you! I didn't realize they would work together. |
Any news about this functionality? Why do flutter sdks lag far behind native sdks? |
@alejandroaap I don't recall any feedback from you testing my PR to bring them up to date? I'd love to hear how it worked for you. Thanks! |
@mikehardy Hi, I have tried it but I couldn't build the app afterwards. Since auth emulator is supported AFAIK from Firebase iOS SDK 7.2.0 or newer, changing globally all my Firebase CocoaPods plugins to that version (I wasn't able to do it for the Auth Pod only) resulted in multiple Swift/Objective C errors when building the App for the simulator and device. I think that Remote Config was one of those plugins that couldn't build with the new Firebase iOS SDK. Thank you for your efforts. |
@jans-y that is unexpected, as remote-config was one of the items considered, and handled in the port ea18fd2 and I specifically added test harness powers that ensured they built and passed tests cf1b55f#diff-cd98883b899aa4ad62ac6b5c5c3db5146fd0a5465749d4d3de63a77c525c04d3R20 cf1b55f#diff-cd98883b899aa4ad62ac6b5c5c3db5146fd0a5465749d4d3de63a77c525c04d3R43-R44 cf1b55f#diff-cd98883b899aa4ad62ac6b5c5c3db5146fd0a5465749d4d3de63a77c525c04d3R110-R111 All of which work locally for me. I'm not saying the PR is perfect, but the problems you had are unexpected vs the specific changes I made, and I suspect something locally was cached or similar. I added a "clean:deep" target to hopefully work around that with It is also possible that the tip of the main branch has moved on in an incompatible way since I posted the PR for consideration. I haven't attempted to run it in the last few days. |
@mikehardy I am trying to test your PR and I am having the following problem when running the application on an iphone.
Any idea why it might be? Thank you. |
Sure, for some reason the underlying firebase-ios-sdk version is not updated correctly. You must have 7.0.0 or greater, 7.3.0 is current as of this writing. Where ever you have it specified, update it to 7.3.0 |
You're right, that was the problem, when will the PR be completed? Thank you |
@alejandroaap I'm not sure as I'm not in control of that in any way, but seeing users request it, and validate that it is working can only help. Make sure you're subscribed to it and have given a thumbs-up reaction to the issue itself at the top - those are a bit like votes, perhaps ask others to do so |
Also perhaps subscribe / thumbs-up the PR itself :-) |
@mikehardy Will this also work for using the firestore emulator? or only for auth? Do we need a new ticket for firestore? Couldn't find any reference to that... |
I believe that firestore and functions emulators are already working and usable. You may see examples of their usage in the code base here if you look in the .github/workflows directory as they are used for the e2e tests that run against commits and PRs here. |
Hi @jlubeck With firestore it's already possible to use the emulator. Take a look at the documentation https://firebase.flutter.dev/docs/firestore/usage `// Import foundation for [TargetPlatform]. // Switch host based on platform. // Set the host as soon as possible. |
Yes! Thank you @mikehardy and @alejandroaap that indeed works. |
Hey, how can I use that PR as my dependency? Should I reference the latest commit on that PR? |
Sorry, I'm not sure I understand (english is not my main language, sorry). So you are saying that just by implementing that PR into my overrides it SHOULD have changed the Podfile to make it work? Because if that's the case, that's not working as intended... |
@mikehardy @alejandroaap I can't seem to find those docs explaining how to override the podfile to use 7.3.0. Would you be so kind to point me to them please? Thanks! |
Apologies, English is my first language but I am not always clear in it :-), also I have learned another language and I know how hard it can be even when things are clear, so I empathize. That said... You should be able to override the versions - I think - by setting [edited to add: I do note that for some reason my firebase_core changes aren't taking effect, I am not sure why but I note it - thank you for that feedback + testing] |
Hi @mikehardy thank you for that. I added that variable in my Podfile, but i'm getting this error on
|
All ios deployment minimums are bumped to 10, corresponding changes are required in the podfile, should get past that |
Step by step... 😓 Now if I do
If I do
|
|
Indeed - those steps should work. Sorry for not having complete instructions on all this, I've been doing cocoapods just long enough that all these things are reflex for me now so I don't think to specify them (pod repo update, deleting locks, reupdating etc) but I definitely remember when I first started with cocoapods and it was all foreign and I had no idea what to do. Quite frustrating. Thanks @Pcol10 for helping! |
I'm about to give up... :( Now I'm getting a bunch of other errors, for example:
|
🤔 that is unexpected, I will not hold it against you at all if you give up, PRs are always hard to integrate and test, I think the way Flutter works makes it even harder with the unified global pub-cache, and this PR in particular is still pretty speculative. So no worries, no expectations. I'm about to refresh the PRs against tip of main branch to make sure they are still "alive"/"fresh" and it's possible something diverged and is not working right now until that is done. You might make sure you are using firebase-ios-sdk 7.3.0 just in case that matters. |
thank you for your constantn help @mikehardy unfortunately even after using 7.3.0, cleaning the flutter projects, the pod files, etc, I'm still getting that last error that I shared. It might be like you said a mix of things... Unless @alejandroaap can chime in to show how he got his working (maybe he doesn't use other Firebase packages like I'm using?), I'm not sure what else to do but wait for further progress on those other tickets. |
Any updates ? With latest updates and bumped SDKs it should be pretty straightforward to enable this, right ? |
PR #4263 contains all progress, follow that for updates. I think it's close (as in, may be ready today? Maybe tomorrow?) but software is notoriously hard to predict yes? So could be longer. All of the necessary pre-requisite work has been completed and merged though (that is: forward-porting across a breaking change version of the underlying firebase SDKs). That took a while. |
This is amazing. |
Mine too |
@LucasHenriqueAbreu @Tinhorn head on over and test the PR then, it should be working fully now as of around 16 hours ago, there are instruction in the PR that show how to test it #4263 |
@mikehardy any updates on this? |
Did you check the PR @deep-randhawa ? It's merged. I think it's even been cherry-picked to the stable branch. There will be no further updates, this should be closed, the work is done now. |
I guess I'll close this as fixed then |
Shouldn't there be documentation how to use it here (https://firebase.flutter.dev/docs/auth/usage), before we close this? |
@sderungs99 Do you mean something like https://firebase.flutter.dev/docs/firestore/usage#emulator-usage? I think you can go ahead and make a separate documentation issue for this. |
Yes, that's exactly what I meant :-) I'm happy to raise an issue, but before I do that, I'm still a bit confused in which exact version of firebase_auth this is available. I checked the PR that is referred above, but that didn't help. Anyone can advise? |
It isn't in stable yet but it will be soon |
@jlubeck Same here, did you find a solution ? |
Nevermind i just had to update the versions of the firebase packages that where in the pubspec.yaml. |
PR #5171 fixes an issue with web |
@wtfiwtz yes! Thanks for cross-linking it here. It comes along with the need to update the firebase-js-sdk dependency which has a known issue with firestore, but those are all being tracked separately. auth.useEmulator has now been successfully tested (by me at least) on iOS/Android/Web |
I think before I've added it here #3969
But basically plugin does not export useEmulator() method to use new Firebase Auth Emulator Suite
The text was updated successfully, but these errors were encountered: