Bug Description
createApplicationSnapshot calls deleteAllByApplicationId to remove all existing snapshot chunks, then calls createSnapshots to write the new ones. There is no transaction wrapping these two operations. If the server crashes or the MongoDB connection drops after the delete completes but before createSnapshots finishes, the application has no valid snapshot at all.
Affected file
�pp/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/ApplicationSnapshotServiceCEImpl.java, lines 44-50:
java .flatMapMany(artifactExchangeJson -> { return applicationSnapshotRepository .deleteAllByApplicationId(branchedApplicationId) // (1) old snapshot destroyed .thenMany(createSnapshots(branchedApplicationId, applicationJson)); // (2) new snapshot written }) // no .as(transactionalOperator::transactional)
A TransactionalOperator bean is configured in MongoConfig.java. The import path at ImportServiceCEImpl.java:552 already uses .as(transactionalOperator::transactional) for its multi-step writes - the snapshot path has no equivalent.
Failure scenario
- Developer creates a snapshot before a risky refactor.
- deleteAllByApplicationId commits - all previous snapshot chunks are gone.
- Server receives SIGTERM (deploy restart), OOM kill, or MongoDB connection drops mid-write.
- createSnapshots stops partway through - partial or zero chunks written.
- Snapshot feature reports success or fails with no clear error, but the application has lost its snapshot entirely.
- Developer encounters a problem with their refactor and tries to restore - finds no snapshot.
Fix
Inject TransactionalOperator into ApplicationSnapshotServiceCEImpl (it is already available in the application context) and wrap both operations:
java return applicationSnapshotRepository .deleteAllByApplicationId(branchedApplicationId) .thenMany(createSnapshots(branchedApplicationId, applicationJson)) .as(transactionalOperator::transactional);
Environment
Appsmith elease branch (2026-08-13), Java/Spring WebFlux, MongoDB.
Bug Description
createApplicationSnapshot calls deleteAllByApplicationId to remove all existing snapshot chunks, then calls createSnapshots to write the new ones. There is no transaction wrapping these two operations. If the server crashes or the MongoDB connection drops after the delete completes but before createSnapshots finishes, the application has no valid snapshot at all.
Affected file
�pp/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/ApplicationSnapshotServiceCEImpl.java, lines 44-50:
java .flatMapMany(artifactExchangeJson -> { return applicationSnapshotRepository .deleteAllByApplicationId(branchedApplicationId) // (1) old snapshot destroyed .thenMany(createSnapshots(branchedApplicationId, applicationJson)); // (2) new snapshot written }) // no .as(transactionalOperator::transactional)A TransactionalOperator bean is configured in MongoConfig.java. The import path at ImportServiceCEImpl.java:552 already uses .as(transactionalOperator::transactional) for its multi-step writes - the snapshot path has no equivalent.
Failure scenario
Fix
Inject TransactionalOperator into ApplicationSnapshotServiceCEImpl (it is already available in the application context) and wrap both operations:
java return applicationSnapshotRepository .deleteAllByApplicationId(branchedApplicationId) .thenMany(createSnapshots(branchedApplicationId, applicationJson)) .as(transactionalOperator::transactional);Environment
Appsmith elease branch (2026-08-13), Java/Spring WebFlux, MongoDB.