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)
Tracking
(Not tracked)
RESOLVED
FIXED
1.1 QE3 (26jun)
People
(Reporter: kamituel, Assigned: kamituel)
References
Details
Attachments
(1 file, 1 obsolete file)
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.
Comment 1•11 years ago
|
||
I encountered the same bug and write a tiny patch.
Attachment #8429074 -
Flags: review?(etienne)
| Assignee | ||
Comment 2•11 years ago
|
||
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 3•11 years ago
|
||
Comment on attachment 8429074 [details]
ndef-uri-prefix.pat
Probably wont be an appropriate reviewer for this bug anyway :)
Attachment #8429074 -
Flags: review?(etienne)
Comment 4•11 years ago
|
||
Sorry for bothering you. I'm waiting for your fix.
| Assignee | ||
Comment 5•11 years ago
|
||
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)
Comment 6•11 years ago
|
||
(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.
Updated•11 years ago
|
Attachment #8429548 -
Flags: review?(alive) → review+
| Assignee | ||
Comment 7•11 years ago
|
||
No, I didn't know that ;) Thanks, will do next time.
Whiteboard: checkin-needed
Comment 8•11 years ago
|
||
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → 1.1 QE3 (26jun)
Updated•11 years ago
|
Whiteboard: checkin-needed
You need to log in
before you can comment on or make changes to this bug.
Description
•