[TIMOB-13496] iOS: Titanium.Contacts.removeGroup fails
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2013-06-04T20:36:22.000+0000 |
Affected Version/s | Release 3.0.2, Release 3.1.0 |
Fix Version/s | 2013 Sprint 12 API, 2013 Sprint 12, Release 3.2.0 |
Components | iOS |
Labels | module_media, qe-testadded |
Reporter | Mark Burggraf |
Assignee | Ingo Muschenetz |
Created | 2013-01-23T16:19:02.000+0000 |
Updated | 2013-10-15T10:04:48.000+0000 |
Description
The following code fails:
Titanium.Contacts.removeGroup(groupObj);
Titanium.Contacts.save();
The error given is:
[ERROR] : Invalid type passed to function. expected: TiContactsPerson, was: TiContactsGroup in -[ContactsModule removePerson:] (ContactsModule.m:431)
Looking at ContactsModule.m it appears there may be a bug in removeGroup -- it seems to be using code from removePerson. See below:
-(void)removeGroup:(id)arg
{
ENSURE_SINGLE_ARG(arg,TiContactsGroup)
ENSURE_UI_THREAD(removePerson,arg)
[self removeRecord:[arg record]];
}
Please provide a runnable sample app.js
Running the app.js above gives the error: [ERROR] : Invalid type passed to function. expected: TiContactsPerson, was: TiContactsGroup in -[ContactsModule removePerson:] (ContactsModule.m:431) This error is not trappable via a try/catch block, though, since it's thrown at the lower (module) level.
Confirmed with 3.0.2 GA, but the issue is fixed in 3.1.0.v20130403114957.
As of 3.1.0.v20130405170202, this is still not working for us.
Here is updated test code that shows it is not fixed:
Note that, beginning in SDK 3.1, the original error message reported no longer appears. No error is given -- the method simply does not delete the group as it's supposed to.
Ok, confirmed. Our engineering team will review. Thanks.
Fixed in master (3.2.0) by PR https://github.com/appcelerator/titanium_mobile/pull/3884
Group is getting removed on the invocation of Titanium.Contacts.removeGroup Verified fix on: Device : iPhone 5 , iOS version : 7.0 Device : iPod Touch , iOS version : 6.1.3 SDK: 3.2.0.v20131014204636 CLI version : 3.2.0 OS : MAC OSX 10.8.4 Alloy : 1.2.2 Appcelerator Studio, build: 3.2.0.201310112258 XCode : 5