Closed carmenlau closed 6 years ago
When saving record with new asset, it calls Database.findInObject recursively and cause app crash.
Database.findInObject
Testing code:
String base64String = "<base64image>"; byte[] decodedString = Base64.decode(base64String, Base64.DEFAULT); Asset asset = new Asset("test.png", "image/png", decodedString); Record newRecord = new Record("Demo"); newRecord.set("attachment", asset); skygear.getPublicDatabase().save(newRecord, new RecordSaveResponseHandler(){ @Override public void onSaveSuccess(Record[] records) { Record record = records[0]; Object a = record.get("attachment"); if (a instanceof Asset) { Log.d("onSaveSuccess", ((Asset) a).getUrl()); } } @Override public void onPartiallySaveSuccess(Map<String, Record> successRecords, Map<String, Error> errors) { } @Override public void onSaveFail(Error error) { } });
When saving record with new asset, it calls
Database.findInObject
recursively and cause app crash.Testing code: