forcedotcom / SalesforceMobileSDK-iOS

iOS SDK for Salesforce
Other
533 stars 416 forks source link

RESTKit errors on requests with long query strings #25

Closed jhersh closed 12 years ago

jhersh commented 12 years ago

I'm seeing an error thrown when I try to perform a retrieve (either with the block methods or by manually creating a request) with many fields.

Retrieving an account record with 3 fields specified (id, name, industry) works fine, but I'm trying to render a full page layout (as many as 500 fields, possibly more due to lookup fields).

A retrieve using the exact same fields on the exact same record, but over SOAP/zksforce, works.

The request generated:

The error:

2012-01-05 15:37:21.881 SF Viewer[85690:40b] *** -[__NSCFConstantString stringByAppendingPathComponent:]: cannot append path '/services/data/v23.0/sobjects/Account/0013000000sps6sAAA?fields=RecordType.Name%2CAccount_Location__c%2CLastModifiedBy.email%2CCreatedBy.mobilephone%2CjsSDO__Sync_Status_Indicator__c%2Cid%2COwner.email%2COwner.phone%2COwner.city%2CIndustry%2CName%2CShippingCountry%2CCreatedBy.title%2COwner.aboutme%2CIsPersonAccount%2CLastModifiedBy.mobilephone%2CLastModifiedBy.aboutme%2CNumberOfEmployees%2CLastModifiedBy.fullphotourl%2CBillingCity%2COwner.currentstatus%2CLastModifiedBy.currentstatus%2CBillingStreet%2CLastModifiedBy.title%2CParent.RecordTypeId%2CCreatedBy.smallphotourl%2CAnnualRevenue%2CParentId%2CjsSDO__Duplicate__c%2CLastModifiedById%2COwner.department%2CFN__Find_Nearby__c%2CLastModifiedBy.department%2CLastModifiedBy.name%2CShippingState%2CFN__Which_Address__c%2COwnerId%2CjsSDO__Jigsaw_Id__c%2CCreatedBy.currentstatus%2CLastModifiedBy.state%2CWebsite%2COwner.title%2CParent.Name%2CParent.id%2CCreatedDate%2CCreatedBy.aboutme%2CFax%2CBillingState%2CBillingPostalCode%2COwner.fullphotourl%2CRecordTypeId%2COwner.name%2CClosed_Won_Value__c%2CCreatedBy.city%2CCreatedBy.phone%2CShippingCity%2CCreatedById%2COwner.mobilephone%2CLastModifiedBy.phone%2CLastModifiedBy.smallphotourl%2CCreatedBy.state%2COwner.state%2CShippingStreet%2CCreatedBy.email%2COwner.smallphotourl%2CCreatedBy.department%2CLastModifiedDate%2CShippingPostalCode%2CRecordType.id%2CPersonContactId%2CCreatedBy.name%2CType%2CPhone%2CLastModifiedBy.city%2CjsSDO__Additional_Information__c%2CjsSDO__Jigsaw_Last_Sync_Locked__c%2CFN__Mapping_Status__c%2CCreatedBy.fullphotourl%2CBillingCountry' to path ''

Update: This happens on any request with a long query string.

tstellanova-sfdc commented 12 years ago

Looks like this is buried down in RestKit ...will take a look

tstellanova-sfdc commented 12 years ago

It seems someone has reported this issue with RestKit previously (see https://github.com/RestKit/RestKit/issues/321) No fix posted on RestKit yet.

jhersh commented 12 years ago

Ah, unfortunate :/ Looks like all my retrieves will be stuck on SOAP.

jhersh commented 12 years ago

That issue thread suggests what seems to be a simple enough fix. Perhaps we could implement it here?

jhersh commented 12 years ago

It's worth noting that this impacts more than retrieve. I hit this same error while performing a SOSL search, so this may manifest in any REST request with a sufficiently large query string. I am having to revert to SOAP calls for many of my requests. :(

tstellanova-sfdc commented 12 years ago

Yeah it sounds like the right way to fix this would be to submit a fix to RestKit. At the moment we use a simple submodule reference to a specific RestKit version. However, for PhoneGap/callback-ios we actually reference our own fork to decouple ourselves a bit from the churn on PhoneGap (now "cordova-ios"). We could do something similar with RestKit since we're probably overdue for a RestKit refresh anyway. I'll discuss with the team internally. This is an important issue and we don't want to let it slip through the cracks.

tstellanova-sfdc commented 12 years ago

First step is in progress. See: https://github.com/forcedotcom/SalesforceMobileSDK-iOS/pull/28

tstellanova-sfdc commented 12 years ago

fixed with latest code