From 8c1f49db9aaac0d517bcd2b919d2a6a960201653 Mon Sep 17 00:00:00 2001
From: Alexis Merelo <alexis.merelo@clevy.io>
Date: Thu, 2 Jun 2022 16:09:25 +0200
Subject: [PATCH] fix sqlite

---
 .env.example                                     | 1 +
 csml_engine/src/db_connectors/sqlite/messages.rs | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/.env.example b/.env.example
index b8fb35f9..ed741f3d 100644
--- a/.env.example
+++ b/.env.example
@@ -27,6 +27,7 @@ ENGINE_SERVER_API_KEYS=someAuthKey4CsmlServer,someOtherAuthKey
 ENGINE_ENCRYPTION_SECRET=some-secret-string # if not set, data will not be stored encrypted
 TTL_DURATION=30 # auto-remove chatbot user data after X days
 LOW_DATA_MODE=true # do not store contents of sent/received messages
+STEP_LIMIT=30 # step the limit of steps that the interpreter can handle per request
 DISABLE_SSL_VERIFY=false # reach trusted endpoints with known invalid certificates
 DEBUG=true # print debug output in console
 CSML_LOG_LEVEL=error # print log output in stderr. Possible values are error, warn, info, debug, trace.
diff --git a/csml_engine/src/db_connectors/sqlite/messages.rs b/csml_engine/src/db_connectors/sqlite/messages.rs
index 431ddcea..14201481 100644
--- a/csml_engine/src/db_connectors/sqlite/messages.rs
+++ b/csml_engine/src/db_connectors/sqlite/messages.rs
@@ -35,7 +35,7 @@ pub fn add_messages_bulk(
             conversation_id,
 
             flow_id: &data.context.flow,
-            step_id: &data.context.step.get_step(),
+            step_id: data.context.step.get_step_ref(),
             direction,
             payload: encrypt_data(&message)?,
             content_type: &message["content_type"].as_str().unwrap_or("text"),