Re: [web-nfc] The description of multiple scan() calls is a bit vague (#351)

I think this is a leftover from NFCReader related spec changes done earlier.

There is some inconsistency with NFCReader.
The NFCReader object just gives access to the read API. It is the `scan()` method that takes filters.
However, the NFCReader object has internal slots from a single filter. Looks like repeated calls to `scan()` will replace the filter.
The global slot [[ActivatedReaderList]] takes multiple possible reader objects, each with internal slots initialized from one filter. Note that the abort signal is also put there by the scan() algo.
I wonder could we take the filter to the NFCReader constructor, @kenchris? Or would the abort signal related steps of the [scan()](https://w3c.github.io/web-nfc/#the-scan-method) algo be considered side-effect in a constructor?

It seems we have no ways to remove NFCReader objects from [[ActivatedReaderList]], other than the abort signal, or if that was not set, then it needs invoking scan() with it an abort signal and then abort that. Non-abortable readers cannot be removed otherwise.
BTW step 3.1 in the [scan() algo](https://w3c.github.io/web-nfc/#the-scan-method) doesn't check for `undefined` and a filter with its `signal` set to `undefined` will break the algo in step 7, IMHO.

Since now we have NFCReader objects, essentially bound to a single filter, we currently don't have a way to support combined filters, therefore we should remove that sentence.

It's another issue (needing a use case) whether we want to support combined filters, e.g. 
1. a list of filters that would be in OR relationship, 
2. or at the filter dictionary level we'd allow arrays with OR semantics and on the upper level a list of filters would have AND semantics. 

At the moment we will not support any combined filters in the coming version.

-- 
GitHub Notification of comment by zolkis
Please view or discuss this issue at https://github.com/w3c/web-nfc/issues/351#issuecomment-531740683 using your GitHub account

Received on Monday, 16 September 2019 11:37:34 UTC