Google Groups

WebAPI for message confirmation

Luke Wagner Nov 21, 2013 10:04 AM
Posted in group:
I have a specific use case which Jonas thought motivated a general solution to a related set of problems:

There are plans and a patch (in bug 839058) for an 'install-complete' message delivered to interested apps right after installation.  Unfortunately, the handling of this message does not block the FFOS install UI which means that the app can be launched before it has finished handling 'install-complete'.  This makes 'install-complete' unsuitable for constructor-like operations which establish some initial state for the app.  What I'd like is if there was a way for an app to respond that the message was handled so that the FFOS install UI could wait for this message before declaring the app "installed" and allowing the user to run the app.

>From Jonas's reply:

In general we need a mechanism for system message handlers to indicate
that they have successfully handled a message. This is something that
has been discussed before and is needed for other reasons (dataloss in
case of crash for example). If we had that we could wait with
considering the application successfully installed until the message
was handled.

So perhaps then the proposal is for some standard for indicating messages as being "handled".  One thought is that, by default, a message would be considered handled once the handler function returns (so, what we have now), but a handler function could indicate "This message should not be considered handled until I send you a message" (rather like SimpleTest.waitForExplicitFinish() in mochitests).