diff --git a/src/core/modules/impl/handler/WasmHandlerApi.ts b/src/core/modules/impl/handler/WasmHandlerApi.ts index 9c1b6fc4..9e1cc69c 100644 --- a/src/core/modules/impl/handler/WasmHandlerApi.ts +++ b/src/core/modules/impl/handler/WasmHandlerApi.ts @@ -62,6 +62,10 @@ export class WasmHandlerApi extends AbstractContractHandler { }; } } finally { + if (interactionData.interaction.interactionType === 'view') { + // view calls are not allowed to perform any KV modifications + await this.swGlobal.kv.rollback(); + } await this.swGlobal.kv.close(); } }