Re: [web-nfc] Fix #592: scan rejects prior scan (#611)

@zolkis rightly pointed out that write behaviour is different:

```js
nfc_test(async (t, mockNFC) => {
  const ndef1 = new NDEFReader();
  const ndef2 = new NDEFReader();

  const p1 = ndef1.write(test_text_data, {overwrite: false});
  const p2 = ndef2.write(test_url_data, {overwrite: true});

  await new Promise((resolve, reject) => {
    // Make first push pending
    mockNFC.setPendingPushCompleted(false);
    let err = "";
    p1.then(() => {
      reject("pending push should not be fulfilled");
    }).catch(e => {
      err = e.name;
    });
    p2.then(() => {
      assertNDEFMessagesEqual(test_url_data, mockNFC.pushedMessage());
      assertNDEFWriteOptionsEqual( {overwrite: true}, mockNFC.writeOptions());
      assert_equals(err, "AbortError", "the pending push should be aborted");
      resolve();
    });
  });
}, "NDEFReader.write should replace all previously configured write operations.");
```

-- 
GitHub Notification of comment by beaufortfrancois
Please view or discuss this issue at https://github.com/w3c/web-nfc/pull/611#issuecomment-740629421 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Tuesday, 8 December 2020 13:48:19 UTC