Giter Site home page Giter Site logo

Comments (8)

s4cha avatar s4cha commented on May 13, 2024 3

Hi @alladinian @maxkonovalov ,
This should be solved in 3.0.0 (Swift 4) 🎉
Thanks a ton!

from ws-deprecated.

s4cha avatar s4cha commented on May 13, 2024 1

@alladinian Thanks a lot for reporting this.
Indeed latest version uses latest then version that has been patched for some retain cycles.
Looks like the patch ends up changing the behaviour down the road...
I'll try to look at this this week and keep you posted :)

from ws-deprecated.

s4cha avatar s4cha commented on May 13, 2024

@alladinian I haven't forgotten you :)

I've been working on an update for then (freshOS/Then#29)
I'm curious if that would solve your issue and the regressions you pointed out.

Could you elaborate a bit more so that we can test it out ?

Have a wonderful weekend,

from ws-deprecated.

alladinian avatar alladinian commented on May 13, 2024

@s4cha Hi there!
No worries, I appreciate it :)
You're right, I should have elaborated more on this.

The problem I stumbled upon was related to resolveOnMainThread() so I don't think this is an issue of then library.

The implementation of the function captures self (an instance of a Promise) as weak, which means that if we do not hold a strong reference to the promise on which we chained a resolveOnMainThread(), we break the whole chain (since the first promise is deallocated when we reach the end of the local scope - see my example above. Just fill the blanks with print statements & you should be able to verify that finally/hideLoading() is never called...).

The problem is solved by not specifying the captured self as weak, but I did not verify that it doesn't introduce any memory leaks...

I hope that this makes sense and it's helpful to you,

Thanks again for this great project,

Vasilis

from ws-deprecated.

maxkonovalov avatar maxkonovalov commented on May 13, 2024

Hey guys, I can confirm that resolveOnMainThread() stopped working for me, too. The resulting then, onError, etc. never get called. I tried to keep a strong ref to the returned Promise, but it didn't help either.

from ws-deprecated.

s4cha avatar s4cha commented on May 13, 2024

@alladinian can we close this issue?

from ws-deprecated.

alladinian avatar alladinian commented on May 13, 2024

@s4cha Sure, seems to be fixed. Also... Happy new year guys 🍻

from ws-deprecated.

s4cha avatar s4cha commented on May 13, 2024

Yeah! You to @alladinian thanks again for your time and effort !!!
Let 2018 be awesome!!!! 🍾

from ws-deprecated.

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.