sourcebitsllc / chocolatechip-ui

Mobile Web App Framework
www.chocolatechip-ui.com
MIT License
617 stars 88 forks source link

Race condition in $.UIGoToArticle due to 500ms setTimeout #29

Closed mattgoldspink closed 10 years ago

mattgoldspink commented 10 years ago

There is a race condition whereby 2 $.UIGoToArticle invocations may be made in swift succession - for example I do the following:

If the results return within 500ms (some queries are super quick on my server because they're cached) the second call is ignored because $.isNavigating is still set to true. I don't see why 500ms is really needed as it is a fair assumption that by the end of this function the css classes in the DOM have been written through and hence the browser will have made the transition, therefore using a setTimeout of 1 should allow the browser to do the actual UI updates if needed and conclude that navigating is complete.

mattgoldspink commented 10 years ago

Fair point, I guess I can pretty easily do that. Part of my original reasoning was so I could have all the screens I needed pre-rendered in the DOM, but I guess there's no harm in shifting the loading screen into a template and rendering it after submitting & then update with the result once it comes back.

mattgoldspink commented 10 years ago

Sorry ignore this new pull request - I need to create a separate branch and issue for it

rbiggs commented 10 years ago

Hey Matt,

Here's a link to a Codepen example with dynamic links. I hope this helps you.

http://codepen.io/rbiggs/pen/JaLHx

On Thursday, December 26, 2013 2:36 PM, Matt Goldspink notifications@github.com wrote:

Sorry ignore this new pull request - I need to create a separate branch and issue for it — Reply to this email directly or view it on GitHub.

mattgoldspink commented 10 years ago

Thanks Robert, that's a big help.

Matt — Sent from Mailbox for iPhone

On Mon, Dec 30, 2013 at 5:47 PM, Robert Biggs notifications@github.com wrote:

Hey Matt, Here's a link to a Codepen example with dynamic links. I hope this helps you. http://codepen.io/rbiggs/pen/JaLHx On Thursday, December 26, 2013 2:36 PM, Matt Goldspink notifications@github.com wrote:

Sorry ignore this new pull request - I need to create a separate branch and issue for it —

Reply to this email directly or view it on GitHub.

Reply to this email directly or view it on GitHub: https://github.com/sourcebitsllc/chocolatechip-ui/pull/29#issuecomment-31357934

sourcebits-robertbiggs commented 10 years ago

Of course! Devleopers always want to go in an change things. They’re already doing that with the current ChUI. :-) Sometimes they come up with good stuff that I pull in.

On Dec 31, 2013, at 5:53 AM, Matt Goldspink notifications@github.com wrote:

Thanks Robert, that's a big help.

Matt — Sent from Mailbox for iPhone

On Mon, Dec 30, 2013 at 5:47 PM, Robert Biggs notifications@github.com wrote:

Hey Matt, Here's a link to a Codepen example with dynamic links. I hope this helps you. http://codepen.io/rbiggs/pen/JaLHx On Thursday, December 26, 2013 2:36 PM, Matt Goldspink notifications@github.com wrote:

Sorry ignore this new pull request - I need to create a separate branch and issue for it —

Reply to this email directly or view it on GitHub.

Reply to this email directly or view it on GitHub: https://github.com/sourcebitsllc/chocolatechip-ui/pull/29#issuecomment-31357934 — Reply to this email directly or view it on GitHub.

sourcebits-robertbiggs commented 10 years ago

Ooops, wrong person. ;-P That was for an discussion about our port of ChUI to Angularjs. Not sure if you’re familiar with it. We’re discussing how we want to approach the development of the branch, making it easy for developers to change to suit their purposes.

Hope the link proves useful. If not hit me up again.

On Dec 31, 2013, at 5:53 AM, Matt Goldspink notifications@github.com wrote:

Thanks Robert, that's a big help.

Matt — Sent from Mailbox for iPhone

On Mon, Dec 30, 2013 at 5:47 PM, Robert Biggs notifications@github.com wrote:

Hey Matt, Here's a link to a Codepen example with dynamic links. I hope this helps you. http://codepen.io/rbiggs/pen/JaLHx On Thursday, December 26, 2013 2:36 PM, Matt Goldspink notifications@github.com wrote:

Sorry ignore this new pull request - I need to create a separate branch and issue for it —

Reply to this email directly or view it on GitHub.

Reply to this email directly or view it on GitHub: https://github.com/sourcebitsllc/chocolatechip-ui/pull/29#issuecomment-31357934 — Reply to this email directly or view it on GitHub.