Closed
Bug 960510
Opened 11 years ago
Closed 11 years ago
B2G NFC: type, id and payload should be optional in MozNDEFRecord
Categories
(Firefox OS Graveyard :: NFC, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
1.4 S4 (28mar)
People
(Reporter: allstars.chh, Assigned: allstars.chh)
References
Details
Attachments
(3 files, 3 obsolete files)
From NDEF spec, type and id could be optional.
However if we call new MozNdefRecord() with id or type is null, error will happen.
This is also the reason why nfc_manager in Gaia has some many new Uint8Array([]) calls.
Assignee | ||
Updated•11 years ago
|
Summary: B2G NFC: type and id should be optional in MozNdefRecord → B2G NFC: type and id should be optional in MozNDEFRecord
Assignee | ||
Updated•11 years ago
|
Assignee: nobody → allstars.chh
Assignee | ||
Comment 1•11 years ago
|
||
From NDEF Spec,
3.2.9 Payload Length
"A payload length of 0 is allowed in which case the PAYLOAD field is omitted from the NDEF record."
Payload could also be optional.
Summary: B2G NFC: type and id should be optional in MozNDEFRecord → B2G NFC: type, id and payload should be optional in MozNDEFRecord
Assignee | ||
Comment 2•11 years ago
|
||
Assignee | ||
Comment 3•11 years ago
|
||
Assignee | ||
Updated•11 years ago
|
Attachment #8376961 -
Flags: review?(khuey)
Assignee | ||
Updated•11 years ago
|
Attachment #8376962 -
Flags: review?(dlee)
Updated•11 years ago
|
Attachment #8376962 -
Flags: review?(dlee) → review+
Assignee | ||
Comment 4•11 years ago
|
||
Attachment #8377409 -
Flags: review?(alive)
Updated•11 years ago
|
Attachment #8377409 -
Flags: review?(alive) → review+
Comment on attachment 8376961 [details] [diff] [review]
Part 1: Make type, id and payload optional
Review of attachment 8376961 [details] [diff] [review]:
-----------------------------------------------------------------
You can't call JS::ExposeObjectToActiveJS on things that are null. Try to get some of the properties you didn't pass in and you'll see the crash.
Please add this to your testcase.
Attachment #8376961 -
Flags: review?(khuey) → review-
Assignee | ||
Comment 6•11 years ago
|
||
Thanks for the review, Kyle.
It did crashed. :P
updated the patch and ask for r? again.
Attachment #8376961 -
Attachment is obsolete: true
Attachment #8378836 -
Flags: review?(khuey)
Assignee | ||
Comment 7•11 years ago
|
||
Test case for accessing members and checking for null.
Given that Part 2 is already r+, so I make it another patch for Kyle to review.
Once it's r+ I will merge two tests into one patch.
Attachment #8378840 -
Flags: review?(khuey)
Attachment #8378836 -
Flags: review?(khuey) → review+
Attachment #8378840 -
Flags: review?(khuey) → review+
Assignee | ||
Comment 8•11 years ago
|
||
Thanks for the review,
given the new policy I'll push these patches after 2/28.
ni? to myself in case I forgot.
Flags: needinfo?(allstars.chh)
Assignee | ||
Comment 9•11 years ago
|
||
Merged Part 2 patches into one.
Attachment #8376962 -
Attachment is obsolete: true
Attachment #8378840 -
Attachment is obsolete: true
Attachment #8392655 -
Flags: review+
Assignee | ||
Comment 10•11 years ago
|
||
Assignee | ||
Comment 11•11 years ago
|
||
Gaia patch merged.
https://github.com/mozilla-b2g/gaia/commit/2c46348849db3dc39b25010aad334252ba9c5e59
Flags: needinfo?(allstars.chh)
https://hg.mozilla.org/mozilla-central/rev/fbc9b3cba3fe
https://hg.mozilla.org/mozilla-central/rev/82e2e931b427
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → 1.4 S4 (28mar)
You need to log in
before you can comment on or make changes to this bug.
Description
•