GithubHelp home page GithubHelp logo

I fear we messed up about snapdrop-android HOT 11 CLOSED

fm-sys avatar fm-sys commented on July 4, 2024
I fear we messed up

from snapdrop-android.

Comments (11)

fm-sys avatar fm-sys commented on July 4, 2024 1

yea i see, i feel like that doesnt work at all, bacause onDestroy isnt always called...

Yes, when reinstalling at the emulator it doesn't get called, but under real life conditions it's mostly fine.

BTW, I really appreciate your continuous work for Snapdrop for Android - reduce the code/maintain complexity and making it better from user perspective. Thanks for your help!

from snapdrop-android.

ueen avatar ueen commented on July 4, 2024

#74

from snapdrop-android.

fm-sys avatar fm-sys commented on July 4, 2024

I suspect that it may have something to do with loadAgain it seems somewhat hacky to me, could you explain why you implemented it and if it could be removed?

For sure this is a very hacky workaround. Actually I tried to remove that workaround before releasing the new version but somehow the app shows itself as peer which is gone after a website reload. But I can try to debug into it again...

from snapdrop-android.

ueen avatar ueen commented on July 4, 2024

The PR fixes the injection isssue.
Yea the showing itself seem to be due to this code

if (onlinePastThreeMin()) {
            WebStorage.getInstance().deleteAllData();

            cookieManager.setCookie("https://snapdrop.net/",
                    "peerid=" + UUID.randomUUID().toString() + ";" +
                            "path=/server;" +
                            "max-age=86400;"
            );
        }

if removed it doesnt show itself anymore...well sometimes it does if you quit and reopen fast...but only once - with this code sometimes the app is creating 3 peers or more
Is this code requiered for anything else?

from snapdrop-android.

fm-sys avatar fm-sys commented on July 4, 2024

Is this code requiered for anything else?

It was required when using my github fork, but probably not when using the original website. Thanks for finding the fix 😃👍

I will try your PR and report back...

from snapdrop-android.

ueen avatar ueen commented on July 4, 2024

I have to say it seems no different if this code is remved or not and i also encountered the app showing itself sometimes with loadAgain and the cookies so i think we can remove that code, then at least the js injection works, but the showing itself issue remains...let me see if i find something int the snapdrop repo

from snapdrop-android.

ueen avatar ueen commented on July 4, 2024

here it is RobinLinus/snapdrop#215
i'm not sure though how to interpret this...maybe we need to send the goodbye to the server before when the app i closed for good?

from snapdrop-android.

fm-sys avatar fm-sys commented on July 4, 2024

I tried to do that in the onDestroy method via leaving the website which works in most cases rather well

from snapdrop-android.

ueen avatar ueen commented on July 4, 2024

yea i see, i feel like that doesnt work at all, bacause onDestroy isnt always called...

from snapdrop-android.

ueen avatar ueen commented on July 4, 2024

Maybe this is only an issue if the app is force closed and reopened, which should be rare under real life conditions, i'll test some more, but i think removing the cookie and loadAgain is a good idea either way, because they do not fully prevent the app from showing itself and add other bugs.

EDIT: yea that seems to be the case, there are no duplicates if the app is

  • in the background long enough
  • the app is closed and opened after a few minutes (2-3)

so you can safely merge :)

from snapdrop-android.

ueen avatar ueen commented on July 4, 2024

sure no problem, this was really bugging me :P

from snapdrop-android.

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.