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

Re: [wake-lock] WakeLock.request() returns a promise that never resolves (#226)

From: Reilly Grant via GitHub <sysbot+gh@w3.org>
Date: Wed, 07 Aug 2019 16:33:19 +0000
To: public-device-apis-log@w3.org
Message-ID: <issue_comment.created-519173974-1565195598-sysbot+gh@w3.org>
I agree that the API is potentially confusing. The Promise returned by `WakeLock.request()` never resolves. It only rejects when the wake lock has been released. This is the result of an extensive conversation that resulted in #201.

The intuition is that the "lock acquired" state is uninteresting. If we fail to acquire a wake lock it will happen quickly and the Promise will be rejected. If we successfully acquire a lock the site only cares if that lock is taken away from it.

GitHub Notification of comment by reillyeon
Please view or discuss this issue at https://github.com/w3c/wake-lock/issues/226#issuecomment-519173974 using your GitHub account
Received on Wednesday, 7 August 2019 16:33:21 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 19:34:28 UTC