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

Strange behaviour, maybe an error when using peek on Android 5.1.1 #2761

Open
lbuse opened this issue Apr 3, 2024 · 0 comments
Open

Strange behaviour, maybe an error when using peek on Android 5.1.1 #2761

lbuse opened this issue Apr 3, 2024 · 0 comments

Comments

@lbuse
Copy link

lbuse commented Apr 3, 2024

The following code runs fine on newer Android versions. However, I've encountered an issue on Android 5.1.1.

After an HTTP request is returned, attempting to use peek to retrieve either the data or an error response results in unexpected behavior.

My request looks like this:

public Either<Failure, Authenticated> executeRequest(Params params) {
// return Failure or Authenticated
}

I expect the result to be received in my view model. Here's a simplified example of the expected behavior:

myUseCase.execute(signIn).peek(
   failure -> {},
   result -> {}
);

Neither the failure nor the success callback is triggered in the view model. However, I observed the following log message:

Rejecting re-init on previously-failed class java.lang.Class<io.vavr.control.Either$$ExternalSyntheticLambda0>
Rejecting re-init on previously-failed class java.lang.Class<io.vavr.control.Either$$ExternalSyntheticLambda0>
Rejecting re-init on previously-failed class java.lang.Class<io.vavr.control.Either$$ExternalSyntheticLambda1>
Rejecting re-init on previously-failed class java.lang.Class<io.vavr.control.Either$$ExternalSyntheticLambda1>
Rejecting re-init on previously-failed class java.lang.Class<io.vavr.control.Either$$ExternalSyntheticLambda2>
Rejecting re-init on previously-failed class java.lang.Class<io.vavr.control.Either$$ExternalSyntheticLambda2>
Rejecting re-init on previously-failed class java.lang.Class<io.vavr.Function1>
Rejecting re-init on previously-failed class java.lang.Class<io.vavr.Function1>
Rejecting re-init on previously-failed class java.lang.Class<io.vavr.PartialFunction>
Rejecting re-init on previously-failed class java.lang.Class<io.vavr.PartialFunction>
Rejecting re-init on previously-failed class java.lang.Class<io.vavr.collection.Seq>
Rejecting re-init on previously-failed class java.lang.Class<io.vavr.collection.Seq>
Rejecting re-init on previously-failed class java.lang.Class<io.vavr.collection.IndexedSeq>
Rejecting re-init on previously-failed class java.lang.Class<io.vavr.collection.IndexedSeq>
Rejecting re-init on previously-failed class java.lang.Class<io.vavr.collection.Vector>
Rejecting re-init on previously-failed class java.lang.Class<io.vavr.collection.Vector>
Rejecting re-init on previously-failed class java.lang.Class<io.vavr.collection.IndexedSeq>
Rejecting re-init on previously-failed class java.lang.Class<io.vavr.collection.Array>
Rejecting re-init on previously-failed class java.lang.Class<io.vavr.collection.Array>
Rejecting re-init on previously-failed class java.lang.Class<io.vavr.collection.Array>
Rejecting re-init on previously-failed class java.lang.Class<io.vavr.collection.IndexedSeq>
Rejecting re-init on previously-failed class java.lang.Class<io.vavr.collection.CharSeq>
Rejecting re-init on previously-failed class java.lang.Class<io.vavr.collection.CharSeq>
Rejecting re-init on previously-failed class java.lang.Class<io.vavr.collection.CharSeq>
Rejecting re-init on previously-failed class java.lang.Class<io.vavr.PartialFunction>
Rejecting re-init on previously-failed class java.lang.Class<io.vavr.collection.Map>
Rejecting re-init on previously-failed class java.lang.Class<io.vavr.collection.Map>
Rejecting re-init on previously-failed class java.lang.Class<io.vavr.collection.Map>
Rejecting re-init on previously-failed class java.lang.Class<io.vavr.collection.Map>
Rejecting re-init on previously-failed class java.lang.Class<io.vavr.collection.Map>
Rejecting re-init on previously-failed class java.lang.Class<io.vavr.collection.Seq>
Rejecting re-init on previously-failed class java.lang.Class<io.vavr.collection.LinearSeq>
Rejecting re-init on previously-failed class java.lang.Class<io.vavr.collection.LinearSeq>
Rejecting re-init on previously-failed class java.lang.Class<io.vavr.collection.List>
Rejecting re-init on previously-failed class java.lang.Class<io.vavr.collection.List>
Rejecting re-init on previously-failed class java.lang.Class<io.vavr.collection.List>
Rejecting re-init on previously-failed class java.lang.Class<io.vavr.collection.Map>
Rejecting re-init on previously-failed class java.lang.Class<io.vavr.collection.Map>
Rejecting re-init on previously-failed class java.lang.Class<io.vavr.collection.Map>
Rejecting re-init on previously-failed class java.lang.Class<io.vavr.collection.Map>
Rejecting re-init on previously-failed class java.lang.Class<io.vavr.collection.LinearSeq>
Rejecting re-init on previously-failed class java.lang.Class<io.vavr.collection.Queue>
Rejecting re-init on previously-failed class java.lang.Class<io.vavr.collection.Queue>
Rejecting re-init on previously-failed class java.lang.Class<io.vavr.collection.Queue>
Rejecting re-init on previously-failed class java.lang.Class<io.vavr.collection.Map>
Rejecting re-init on previously-failed class java.lang.Class<io.vavr.collection.SortedMap>
Rejecting re-init on previously-failed class java.lang.Class<io.vavr.collection.SortedMap>
Rejecting re-init on previously-failed class java.lang.Class<io.vavr.collection.SortedMap>
Rejecting re-init on previously-failed class java.lang.Class<io.vavr.collection.SortedMap>
Rejecting re-init on previously-failed class java.lang.Class<io.vavr.collection.SortedMap>
Rejecting re-init on previously-failed class java.lang.Class<io.vavr.collection.SortedMap>
Rejecting re-init on previously-failed class java.lang.Class<io.vavr.collection.SortedMap>
Rejecting re-init on previously-failed class java.lang.Class<io.vavr.collection.SortedMap>
Rejecting re-init on previously-failed class java.lang.Class<io.vavr.collection.SortedMap>
Rejecting re-init on previously-failed class java.lang.Class<io.vavr.collection.LinearSeq>
Rejecting re-init on previously-failed class java.lang.Class<io.vavr.collection.Stream>
Rejecting re-init on previously-failed class java.lang.Class<io.vavr.collection.Stream>
Rejecting re-init on previously-failed class java.lang.Class<io.vavr.collection.Stream>
Rejecting re-init on previously-failed class java.lang.Class<io.vavr.collection.List>
Rejecting re-init on previously-failed class java.lang.Class<io.vavr.collection.List>
Rejecting re-init on previously-failed class java.lang.Class<io.vavr.collection.Vector>
Rejecting re-init on previously-failed class java.lang.Class<io.vavr.collection.Vector>
Rejecting re-init on previously-failed class java.lang.Class<com.mypackage.myapp.fragments.LoginFragmentViewModel$$ExternalSyntheticLambda1>

If I rewrite this using the following, it works:

Either<Failure, Authenticated> result = myUseCase.execute(signIn);

if(result.isLeft()) {
   Failure failure = result.getLeft();
} else {
   Authenticated authenticated = result.get();
}
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

No branches or pull requests

1 participant