mozilla/r2d2b2g — pull request #667 by mykmelez (2013-06-27 23:13:45+00:00)
Title: show throbber by receipt label when updating receipt (fixes #613)

@potch does this seem reasonable?

I'm not entirely happy with setting *app.updateReceipt*, since the *app* object comes from SimpleStorage and persists across browser sessions, whereas an "update receipt" request always terminates with the session. But there is no session-specific storage at the moment, so setting a property of the *app* object is the best thing we can do. And it should be ok, as the callback deletes the property when the request completes (which should happen even if the user terminates the session in the middle of the request).

In addition to setting *app.updateReceipt*, which ensures the throbber will appear if the user reloads the Dashboard while an update request is underway, the changeset messages the Dashboard when the request starts/stops, so it can update the specific app record. I don't think we have code that does this yet; currently we regenerate the entire app list anytime anything changes. But it seems preferable to update the specific record than to regenerate the whole list, especially if regeneration takes non-negligible time, so the list doesn't flash in a distracting way.

Ultimately we'll want a more general solution, but that can wait until another development cycle.