-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Update Firebase Versions #1313
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
Update Firebase Versions #1313
Conversation
Change-Id: I4f294892ec3fcac175a567b5fecf6cf7715930a0
|
Hmmm... "non-breaking" updates but our tests start failing 🤔😂. I'm just messing with you, but yeah, our tests broke for whatever reason. |
|
@SUPERCILEX I am getting some very strange mockito failures on all tests. Fixing... |
|
Ok I have absolutely no idea what is going on. And I don't actually think any of our tests were running before ... |
|
Huh, we are using a dynamic version for mockito so maybe try using a fixed one that we know works? |
|
Oh wait I know what it is. This beauty definitely stopped working: private static void injectMockFirebaseAuth(FirebaseApp app) {
for (Field field : FirebaseAuth.class.getDeclaredFields()) {
field.setAccessible(true);
Object o;
try {
o = field.get(null);
} catch (IllegalAccessException e) {
throw new IllegalStateException(e);
} catch (NullPointerException e) {
continue;
}
Type genericType = field.getGenericType();
if (o instanceof Map && genericType instanceof ParameterizedType) {
Type[] parameterTypes = ((ParameterizedType) genericType).getActualTypeArguments();
if (parameterTypes.length != 2 || parameterTypes[0] != String.class
|| parameterTypes[1] != FirebaseAuth.class) {
continue;
}
//noinspection unchecked
Map<String, FirebaseAuth> instances = (Map<String, FirebaseAuth>) o;
FirebaseAuth.getInstance(app);
for (String id : instances.keySet()) {
instances.put(id, mock(FirebaseAuth.class));
}
break;
}
} |
|
Ouch, so is FirebaseAuth storing instances of itself differently? Do you want me to take a look or are you good? |
Change-Id: I5b5495b15e1a9928eee12b9c05f3fb655b753802
|
I think I can figure it out. I am now at the point where my tests are green in Android Studio but red on the command line ... man Android testing is a joke! |
Change-Id: I5f0bc8c15ea12086e5005965018cd61154e8e661
|
Haha, it's usually the other way around for me. 😉 Fingers crossed 🤞, right? 😂 |
|
Ok they are all failing like this: Here's the line it doesn't like in FirebaseAuth mockAuth = FirebaseAuth.getInstance(app);
when(mockAuth.setFirebaseUIVersion(anyString())) // <----- THIS ONE
.thenReturn(Tasks.<Void>forResult(null));@SUPERCILEX any ideas? |
|
Well darn, there's a new |
|
Alright, I think I got it. |
|
@samtstern Ok, so things aren't looking too pretty. After investigating for ages how we could inject auth into the |
|
Thanks for giving it a shot anyway. I'll try and figure it out by
comparing the obfuscated code to the real source.
…On Wed, May 23, 2018, 5:39 PM Alex Saveau ***@***.***> wrote:
@samtstern <https://github.com/samtstern> Ok, so things aren't looking
too pretty. After investigating for ages how we could inject auth into the final
ComponentContainer implementation, I realized that we don't even need to
do it anymore since the setFirebaseUIVersion method is wrapped in a try
catch anyway. (So that means you should be able to nuke the entire
injectMockFirebaseAuth method.) However, now I can't get FirebaseAuth to
not be null... it's kinda hard to understand how the components are added
with minified and obfuscated source code. 😢 To me it looks like the
component providers should be coming from the manifest, but I'm not sure.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1313 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AIEw6t0WxijJ95HETGS4z1wub5tu8ZSaks5t1gFOgaJpZM4ULQyW>
.
|
Change-Id: I4b4c8aa0c26738bdaa74dac846194c59744ca73a
|
@SUPERCILEX after looking at how I have put in a very simple (and temporary) hack to get tests to pass: a Given that we really need to ship 4.0 to make the deadline for GDPR, I am inclined to go ahead with this testing hack and fix it in the next release by doing better injection of |
|
Wow squash and merge is very broken. |
|
@samtstern #1337 addresses the testing hacks. |

These changes look breaking but they're actually safe, the major version number was to escape the version-range hell created by the previous release.