Giter Site home page Giter Site logo

Comments (11)

tbruyelle avatar tbruyelle commented on May 7, 2024

The crash was introduced with 88d83bb where I moved code from onDestroy to onStop.

Quick solution is to move the client code in onStart rather than onCreate but I dislike the idea. Too bad we can't rely on onDestroy, since this is the only method in the lifecycle where it is certain that onCreate will be invoked on back. With onStop, it can be onCreate or onStart, it depends... Android lifecycle is really a fucking disaster, so tired of fighting against it for years...

I try to find an other fix.

from rxpermissions.

ashalmawia avatar ashalmawia commented on May 7, 2024

Is it really important to do
mSubjects.clear();
in the onShadowActivityStop()? If the activity dies, this list will be just dropped with it, otherwise, if the activity survives and continues its lifecycle, we need this list untouched (bug is actually caused by its emptiness after onStop()).

I removed it and checked the main cases, everything works as expected.

from rxpermissions.

tbruyelle avatar tbruyelle commented on May 7, 2024

Yes it's important for a feature that begin to annoy me : multiple request handling.

But I'm going to take my axe, remove that feature and at the same time some complicated code. I don't think people uses it. Even me I'm not using it any more.

from rxpermissions.

ashalmawia avatar ashalmawia commented on May 7, 2024

I am using it :) We are requesting android.permission.CAMERA and android.permission.RECORD_AUDIO at the same point.

Aha, I see - there is a case, when I request two permissions simultaneously, DNKA on, I press "Allow" on the first dialog, then fold the app up, retrieve it back, press "Allow" on the second dialog. Without this line of code, result would not be delivered.
In the current implementation of the library, however, it produces the same crash as in the description of the issue.

I'll look for some ways to handle it.

from rxpermissions.

tbruyelle avatar tbruyelle commented on May 7, 2024

I'm not talking about multiple requests when you provide 2 or more parameters, I'm talking about multiple requests done at the same time for the same permission in 2 different places of your code.
So, do you really use that feature ?

from rxpermissions.

ashalmawia avatar ashalmawia commented on May 7, 2024

That one no (and, honestly speaking, I can hardly imagine a case when it could be inevitably needed).

from rxpermissions.

tbruyelle avatar tbruyelle commented on May 7, 2024

I can hardly imagine a case when it could be inevitably needed

I agree, I was probably drunk when I decided to handle that.

I pushed a fix to master, could you check if it's ok (also if possible the last test you made about multiple permissions request ?)

Thanks in advance!

from rxpermissions.

ashalmawia avatar ashalmawia commented on May 7, 2024

Checked - no crash now, with one permission it works as expected.

For two permissions, requested simultaneously, there is no more crash as well and all works good with DNKA off. With DNKA on, there stays the case when result is not delivered ("Allow" on the first dialog, fold up, retrieve, "Allow" on the second dialog). But I suppose it to be extremely rare, probably not worth wasting time.

Also checked the two previous cases - none reproduces.

That's great :)

Thank you very much for the fixes and quick reaction! You helped us a lot.

from rxpermissions.

tbruyelle avatar tbruyelle commented on May 7, 2024

Good!

About the last issue, I tried to reproduce with sample app, by adding a second permission to the parameter list, with DNKA on, but it worked mostly as expected (mostly because the result was delivered 2 times instead of one to the subscriber, will see if I can improve that).

When you said requested simultaneously you mean by passing more than one parameter ?

from rxpermissions.

ashalmawia avatar ashalmawia commented on May 7, 2024

When you said requested simultaneously you mean by passing more than one parameter ?

Yes. Maybe it's somehow device-specific, I'm testing on Nexus 5, 6.0.1.

Would you please deploy a new version of the library, for us to receive updates?

from rxpermissions.

tbruyelle avatar tbruyelle commented on May 7, 2024

Done, new version is 0.7.0 since a feature has been removed.

from rxpermissions.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.