concerto/concerto — pull request #990 by simplysoft (2014-06-15 21:24:35+00:00)
Title: Fix race conditions in screen refresh

This fixes a race condition in the screen refresh method. (See #988 for details)

When the screen is refreshed, all outstanding requests are aborted. But there can be some requests that are already finished, but the callbacks did not yet fire. The screen refresh will then dispose the template (and its positions, fields, contents).
It can now happen that a content request callback is fired for a position that was disposed previously.

Interesting enough, the position can be set to null in between [field.js#L217](https://github.com/simplysoft/concerto/blob/b48a46a98fe9ad3b07382b42fce5ad5c3c3ae8ad/public/frontend_js/field.js#L217) and
[field.js#L267](https://github.com/simplysoft/concerto/blob/b48a46a98fe9ad3b07382b42fce5ad5c3c3ae8ad/public/frontend_js/field.js#L267)