Re: [web-nfc] Consider removing .nfc namespace

I did not propose selectAdapter() at this step, only a policy to 
select a default adapter, which sometimes would pop up a selection 
dialog if there are multiple external adapters. Not very likely to 
occur, but this would make a clear situation: we use one adapter, and 
we know which one.

But if we speak about selectAdapter():

1. you can call it any time you choose, probably create a selection 
button that the user can use
2. new or old adapter can be selected, according to user choice; if 
the same is selected, nothing changes. 
3. If another adapter is selected, the current one needs to be 
released, but the watches, and even push buffers can relate to the new
 adapter.
4. When the dialog is rejected, the current adapter is not changed. 
The developer can still push/watch.
5. Yes we should switch back to the internal. It would probably be 
good to reject the pending promises with an error message that tells 
the adapter was plugged out/changed. Or, we could transparently switch
 and maintain the watches and push buffer(s). This is not different 
from how you would handle concurrent adapters. But you get rid of the 
nightmare of undeterministic error handling of concurrent adapters 
with only one promise/error message to give. It is wrong in principle,
 though you don't meet the error condition often.

The API is the same simple in all cases, and all options will have 
quirks. I am for the quirks which can be resolved, not the ones for 
which we hope for the best.

-- 
GitHub Notif of comment by zolkis
See https://github.com/w3c/web-nfc/issues/67#issuecomment-151424854

Received on Tuesday, 27 October 2015 09:19:29 UTC