Source:
<code>private boolean checkFormRecordStatus(FormRecord[] records) throws FileNotFoundException, TaskCancelledException { boolean needToSendLogs = false; processor.beginBulkSubmit(); for (int i = 0; i < records.length; ++i) { if (isCancelled()) { throw new TaskCancelledException(); } FormRecord record = records[i]; if (FormRecord.STATUS_COMPLETE.equals(record.getStatus())) { try { records[i] = processor.process(record); } catch (InvalidStructureException | XmlPullParserException | UnfullfilledRequirementsException e) { records[i] = handleExceptionFromFormProcessing(record, e); needToSendLogs = true; } catch (FileNotFoundException e) { if (CommCareApplication.instance().isStorageAvailable()) { Logger.log(LogTypes.TYPE_ERROR_DESIGN, "Removing form record because file was missing|" + getExceptionText(e)); record.logPendingDeletion(TAG, "the xml submission file associated with the record could not be found"); FormRecordCleanupTask.wipeRecord(c, record); <START> records[i] = FormRecord.StandInForDeletedRecord(); <END> } else { CommCareApplication.notificationManager().reportNotificationMessage( NotificationMessageFactory.message(ProcessIssues.StorageRemoved), true); throw e; } } catch (IOException e) { Logger.log(LogTypes.TYPE_ERROR_WORKFLOW, "IO Issues processing a form. " + "Tentatively not removing in case they are resolvable|" + getExceptionText(e)); } } } processor.closeBulkSubmit(); return needToSendLogs; }</code><technical_language>Another option wipeRecord method change status of original record object STATUS_JUST_DELETED. strong feelings here, agree previous behavior feels dangerous</technical_language>

Target:
private boolean checkFormRecordStatus(FormRecord[] records) throws FileNotFoundException, TaskCancelledException { boolean needToSendLogs = false; processor.beginBulkSubmit(); for (int i = 0; i < records.length; ++i) { if (isCancelled()) { throw new TaskCancelledException(); } FormRecord record = records[i]; if (FormRecord.STATUS_COMPLETE.equals(record.getStatus())) { SQLiteDatabase userDb = CommCareApplication.instance().getUserDbHandle(); try { userDb.beginTransaction(); try { records[i] = processor.process(record); userDb.setTransactionSuccessful(); } finally { userDb.endTransaction(); } } catch (InvalidStructureException | XmlPullParserException | UnfullfilledRequirementsException e) { records[i] = handleExceptionFromFormProcessing(record, e); needToSendLogs = true; } catch (FileNotFoundException e) { if (CommCareApplication.instance().isStorageAvailable()) { Logger.log(LogTypes.TYPE_ERROR_DESIGN, "Removing form record because file was missing|" + getExceptionText(e)); record.logPendingDeletion(TAG, "the xml submission file associated with the record could not be found"); FormRecordCleanupTask.wipeRecord(c, record); records[i] = FormRecord.StandInForDeletedRecord(); } else { CommCareApplication.notificationManager().reportNotificationMessage( NotificationMessageFactory.message(ProcessIssues.StorageRemoved), true); throw e; } } catch (IOException e) { Logger.log(LogTypes.TYPE_ERROR_WORKFLOW, "IO Issues processing a form. " + "Tentatively not removing in case they are resolvable|" + getExceptionText(e)); } } } processor.closeBulkSubmit(); return needToSendLogs; }