Closed Bug 951829 Opened 11 years ago Closed 6 years ago

[Contacts API] new mozContact().id returns the string "undefined"

Categories

(Core Graveyard :: DOM: Contacts, defect)

x86_64
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: julienw, Unassigned)

References

Details

Attachments

(2 files, 3 obsolete files)

As discussed in bug 931711, it should probably be null or "" instead.

null:
* make it clear we have no id
* needs a WebIDL change

"":
* the id is defined but is falsy
* doesn't need a WebIDL change

What are other API doing?
Flags: needinfo?(jonas)
Attached patch wip patch v1 (obsolete) — Splinter Review
Assignee: nobody → felash
Attached patch patch v1 (obsolete) — Splinter Review
Try is https://tbpl.mozilla.org/?tree=Try&rev=7372e6313cc0

I'd like to see what Gaia integration tests react on this.
Attachment #8350282 - Attachment is obsolete: true
> 
> I'd like to see what Gaia integration tests react on this.

*how
See Also: → 960937
I don't think there's much consistency between APIs. My experience is that using "" creates fewer edge cases for authors while making most code patterns JustWork.

So "" gets my vote.
Flags: needinfo?(jonas)
Comment on attachment 8706418 [details] [review]
[gaia] julienw:951829-recognize-falsy-id > mozilla-b2g:master

Hey Francisco, what do you think ? This is a small fix to prevent issues when I'll try to land the gecko patch.
Attachment #8706418 - Flags: review?(francisco)
Waiting to get my ssh account back to push to try.
Gij seems happy, which is sad because after all the Gaia patch is not landed yet... this means this part is not tested :/
From dbdf6ce56401e4b2e64dce53d96cdd0d97f9198d Mon Sep 17 00:00:00 2001
 r=reuben
---
 dom/contacts/ContactManager.js                | 6 ++++--
 dom/contacts/tests/test_contacts_basics2.html | 6 ++++++
 dom/webidl/Contacts.webidl                    | 2 +-
 3 files changed, 11 insertions(+), 3 deletions(-)
Attachment #8706447 - Attachment is obsolete: true
Attachment #8350561 - Attachment is obsolete: true
Comment on attachment 8706418 [details] [review]
[gaia] julienw:951829-recognize-falsy-id > mozilla-b2g:master

LGTM :)
Attachment #8706418 - Flags: review?(francisco) → review+
Assignee: felash → nobody
DOM: Contacts isn't used anymore. 
Closing all remaining bugs.
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → WONTFIX
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: