w3c / web-nfc

Web NFC
https://w3c.github.io/web-nfc/
Other
313 stars 69 forks source link

Handling pushed msg exceeds tag's size and how is the msg size calculated #523

Closed Honry closed 4 years ago

Honry commented 4 years ago

Spec should handles when pushed message exceeds the NFC tag's memory size, and may worth to explain how is the pushed message size calculated or maybe just leave it to implementer with a simple Note.

leonhsl commented 4 years ago

I think we need to figure out this from the 2 aspects:

  1. Is it necessary to put a limit on the size of the NDEF message pushed via NDEFWriter#write()?
  2. Is it necessary to put a limit on the size of the NDEF message that can be dispatched to NDEFReader#onreading?

The old (current) WebNFC impl in Chromium imposes a limitation of 32K bytes on both conditions above, but does not implement well in respect of the algorithm for calculating the size of an NDEF message.

WDYT? @zolkis @beaufortfrancois @riju @reillyeon @kenchris

zolkis commented 4 years ago

Spec should handles when pushed message exceeds the NFC tag's memory size

Then the app will get an error. I don't think the spec have to handle this, maybe nice-to-have, but then impl needs to figure out the characteristics of the tag and the underlying NFC implementation and then do the calculation. It is also difficult to fully test it, especially with automated tests and I am not sure that should fall on implementations. I think this is applications' responsibility.

leonhsl commented 4 years ago

Yep this is also what I'm feeling.

So I prefer to remove the 32k bytes limitation from the current Chrome implementation, given that it does not make much sense and the implementation of size calculation is quite buggy.