Closed imransiddiquirn closed 3 months ago
This issue has been fixed in dev in will be in our next release (12.1). See https://github.com/forcedotcom/SalesforceMobileSDK-Android/pull/2586
Same Issue in SDK 12.0.0
Can you give us more details? What casting issue are you running into?
@wmathurin here is the casting issue after adding the above changes. ERROR Error removing from store: java.lang.ClassCastException: java.util.ArrayList cannot be cast to java.lang.Double
I am encountering an issue with the removeFromSoup method in the SmartStore React Native integration. The method fails with a NoSuchKeyException error when attempting to delete entries from a soup using entry IDs.
Details:
Version of Mobile SDK Used:
SDK: v12.0.1 React Native: "0.73.6",
Android 13 Device:
Call the deleteFromSoup method with a soup name and an array of entry IDs.
Example: deleteFromSoup('tcpl_secondarySalesOrder__c', ['16']) .then(result => console.log('Success:', result)) .catch(error => console.error('Error:', error)); Actual Behavior:
The method fails with the following error: SmartStoreReactBridge.removeFromSoup failed: "com.facebook.react.bridge.NoSuchKeyException: querySpec"
SmartStoreReactBridge.removeFromSoup failed: "com.facebook.react.bridge.NoSuchKeyException: querySpec" Code Details:
export const deleteFromSoup = (soupName: any, entries: Array<string>) => { return new Promise<SqlResponseI>((resolve, reject) => { // Check if smartstore object is properly initialized if (!smartstore) { reject(new Error('SmartStore is not initialized.')); return; } // Check if smartstore.removeFromSoup() is available before invoking it if (!smartstore.removeFromSoup) { reject(new Error('SmartStore does not have removeFromSoup method.')); return; } smartstore.removeFromSoup(false, soupName, entries, (suc: any) => { resolve(suc); }, err => { console.log(
error while deleting from soup '${soupName}', err); reject(err); } ); }); };