W3C home > Mailing lists > Public > public-device-apis@w3.org > August 2014

Re: DAP-ISSUE-166: Should getBattery() always return the same promise?

From: Frederick Hirsch <w3c@fjhirsch.com>
Date: Mon, 11 Aug 2014 17:31:00 -0400
Cc: Frederick Hirsch <w3c@fjhirsch.com>, anssi.kostiainen@intel.com, mounir@lamouri.fr, public-device-apis@w3.org
Message-Id: <72228F55-C836-4E73-A7C4-1496D8DD843D@fjhirsch.com>
To: cathy.chan@nokia.com
Cathy

Thanks for the review, I think this editorial comment is helpful and we should update the specification to address it.

We can continue the CfC assuming that an appropriate update will be included when we publish, (especially since you noted this at the beginning).

Thanks

regards, Frederick

Frederick Hirsch, Nokia
Chair DAP
@fjhirsch



On Aug 11, 2014, at 4:39 PM, <cathy.chan@nokia.com> <cathy.chan@nokia.com> wrote:

>> From: ext Kostiainen, Anssi [mailto:anssi.kostiainen@intel.com]
>> 
>> On 08 Aug 2014, at 16:12, Mounir Lamouri <mounir@lamouri.fr> wrote:
>> 
>>> On Fri, 8 Aug 2014, at 19:47, Kostiainen, Anssi wrote:
>>>> I see no downsides in doing this, thus I suggest we change to the
>>>> following:
>>>> 
>>>> [[
>>>> 
>>>> * Let /promise/ be a newly created Promise and return it.
>>>> 
>>>> ]]
>>>> 
>>>> Into:
>>>> 
>>>> [[
>>>> 
>>>> * If there is an initialized-but-unresolved Promise object returned
>>>> by getBattery(), let /promise/ be that Promise object.
>>>> * Otherwise, let /promise/ be a newly created Promise.
>>>> * Return /promise/.
>>>> 
>>>> ]]
>>>> 
>>>> For the contest, please see:
>>>> 
>>>> https://dvcs.w3.org/hg/dap/raw-file/default/battery/Overview.html#the
>>>> -navigator-interface
>>>> 
>>>> All - please report any bugs in the algorithm, and let us know if you
>>>> have any concerns with this change. I'll land this change later if I
>>>> hear no concerns.
>>> 
>>> Why not simply returning the same Promise all the time instead of only
>>> returning un-resolved promises?
>> 
>> Good point, and makes sense. I s/initialized-but-unresolved/initialized/
>> above and landed the change:
>> 
>> https://dvcs.w3.org/hg/dap/rev/27d83813c582
>> 
>> Please review and let us know if you find any other bugs.
> 
> [[If there is an initialized Promise object returned by getBattery(), ...]
> 
> should be 
> 
> [[If there is an initialized Promise object returned on a previous invocation of getBattery(), ...]] or something to that effect. 
> 
> Also, does the promise need to be associated with the browsing context? If so, maybe we can just re-use the language of step 4?
> 
> Finally, the last three steps should only be necessary if a new Promise was created. A simple fix would be to add "Return /promise/." at the end of the first step. (The alternative would be to make the last three steps conditional on a new promise being created, but that makes it a bit more clumsy.)
> 
> - Cathy.
> 
>> 
>> Thanks,
>> 
>> -Anssi
> 
Received on Monday, 11 August 2014 21:31:35 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 19:33:11 UTC