deleteJetpack
Deletes a Jetpack item from Firestore (hard delete).
This method permanently removes the document from Firestore. Warning: This is a destructive operation and cannot be undone.
Soft Delete vs Hard Delete
In practice, this template uses soft deletes by setting deleted = true via createOrUpdateJetpack. Hard deletion using this method should only be used for:
Final cleanup after all devices have synchronized the soft delete
Administrative operations
GDPR/data deletion requests
Recommended Pattern (Soft Delete)
// Instead of calling deleteJetpack():
val softDeleted = item.copy(
deleted = true,
lastUpdated = System.currentTimeMillis()
)
firebaseDataSource.createOrUpdateJetpack(softDeleted)Content copied to clipboard
Hard Delete Usage
suspend fun permanentlyDelete(item: JetpackEntity) {
// First, ensure all devices have synced the soft delete
if (allDevicesSynced(item.id)) {
firebaseDataSource.deleteJetpack(item.toFirebase())
localDataSource.hardDelete(item.id)
}
}Content copied to clipboard
Document Path
/dev.atick.jetpack/jetpacks/{userId}/{jetpackId}
Parameters
firebaseJetpack
The FirebaseJetpack object to delete. Only the ID field is used to identify the document to delete.
Throws
FirebaseFirestoreException
if deletion fails
FirebaseNetworkException
if network is unavailable
if Firestore security rules deny deletion