Re: [web-nfc] Do we need to compare the ScanOptions? (#557)

For a given [NDEFReader](https://w3c.github.io/web-nfc/#dom-ndefreader), its [scan() algorithm](https://w3c.github.io/web-nfc/#the-scan-method) says:

![Screenshot from 2020-04-13 21-48-09](https://user-images.githubusercontent.com/996058/79150124-e6f97880-7dd0-11ea-817a-5091bb5b014a.png)

In 4.1., if a new signal is specified, replace the old one.
If not specified, keep the old one.
In step 5, if the signal is aborted (even if the old one), reject the promise.
In step 6, if there is a signal, set up the signal abort steps.
So yes, according to these steps, if the new filter does not specify a signal, it inherits the old one.

So @DonnaWuDongxia you are correct, but @kenchris , is this really what was meant?

I find this inconsistent, as I would expect that if the new filter does not specify a signal, then there is no signal in the new scan, since the signal is part of [NDEFScanOptions](https://w3c.github.io/web-nfc/#dom-ndefscanoptions). (Unless there is some convention about signals that I miss here).

Also, note that in step 7.4, the reader is attempted to be added _again_ to the [activated reader list](https://w3c.github.io/web-nfc/#dfn-activatedreaderlist), which is a set, which does not allow duplicated and ignores adding if the item already exists in the set. So we only update the internal slots of the reader.

![Screenshot from 2020-04-13 22-07-02](https://user-images.githubusercontent.com/996058/79151487-30e35e00-7dd3-11ea-9ccb-a248ee97f995.png)




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

Received on Monday, 13 April 2020 19:12:28 UTC