Closed Bug 1016093 Opened 11 years ago Closed 11 years ago

[NFC] Lack of support for unabbreviated URI's in NDEF URI records.

Categories

(Firefox OS Graveyard :: Gaia::System, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
1.1 QE3 (26jun)

People

(Reporter: kamituel, Assigned: kamituel)

References

Details

Attachments

(1 file, 1 obsolete file)

46 bytes, text/x-github-pull-request
alive
: review+
Details | Review
NfcManager.formatURIRecord() does not support unabbreviated URI's in NDEF URI records. This means that if first byte of payload is 0x00 (which, according to NFCForum-TS-RTD_URI_1.0 means content is unabbreviated), NDEF message will not be handled at all. Steps to reproduce: 1. Use emulator with NFC support 2. Set up RE0 and LLCP 3. nfc snep put -1 -1 [208,1,VQ,AGh0dHA6Ly9tb3ppbGxhLmNvbQ,A] What should happen: Browser should launch with http://mozilla.com loading. What happens: Nothing. Reason is twofold: invalid "if" statement in formatURIRecord() causes it to return null when prefix is '' (empty string). And switch below that does not handle that case.
No longer blocks: NFC-Gaia
Blocks: NFC-Gaia
Attached file ndef-uri-prefix.pat (obsolete) —
I encountered the same bug and write a tiny patch.
Attachment #8429074 - Flags: review?(etienne)
Junichi, couple of issues I have: 1) I'm working on that already - please look at "assigned to" field, it's assigned to me. Please do not waste my work by submitting your patch. 2) Your patch is invalid, it won't work. 3) Once you'll work on your own bug, you should make pull request using github, not attach patch as a file here.
Comment on attachment 8429074 [details] ndef-uri-prefix.pat Probably wont be an appropriate reviewer for this bug anyway :)
Attachment #8429074 - Flags: review?(etienne)
Sorry for bothering you. I'm waiting for your fix.
Attached file Pull request
Resolves this issue by: - fixing incorrect "if" statement - rewriting formatURIRecord() so it makes a decision based not on prefix, but on the decoded URI instead. Unit test is there as well. Oh, and Travis failed with "Error: Cannot find module 'sockit-to-me'". This is Node.js/npm issue, no idea why it happened.
Attachment #8429074 - Attachment is obsolete: true
Attachment #8429548 - Flags: review?(alive)
(In reply to Kamil Leszczuk from comment #5) > Created attachment 8429548 [details] [review] > Pull request > > Resolves this issue by: > - fixing incorrect "if" statement > - rewriting formatURIRecord() so it makes a decision based not on prefix, > but on the decoded URI instead. > > Unit test is there as well. > > Oh, and Travis failed with "Error: Cannot find module 'sockit-to-me'". This > is Node.js/npm issue, no idea why it happened. Do you know you could login to travis with github account and re-run your test by a re-run button? Just a note.
Attachment #8429548 - Flags: review?(alive) → review+
No, I didn't know that ;) Thanks, will do next time.
Whiteboard: checkin-needed
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → 1.1 QE3 (26jun)
Whiteboard: checkin-needed
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: