mirror of
https://github.com/langgenius/dify.git
synced 2026-04-30 15:38:08 +08:00
feat: move version update logic out of save_memory
This commit is contained in:
@ -73,7 +73,7 @@ class MemoryEditApi(WebApiResource):
|
||||
is_draft=False
|
||||
)
|
||||
|
||||
# Create updated memory instance
|
||||
# Create updated memory instance with incremented version
|
||||
updated_memory = MemoryBlock(
|
||||
spec=existing_memory.spec,
|
||||
tenant_id=existing_memory.tenant_id,
|
||||
@ -81,7 +81,7 @@ class MemoryEditApi(WebApiResource):
|
||||
conversation_id=existing_memory.conversation_id,
|
||||
node_id=existing_memory.node_id,
|
||||
value=update, # New value
|
||||
version=existing_memory.version, # Keep current version (save_memory will handle version increment)
|
||||
version=existing_memory.version + 1, # Increment version for update
|
||||
edited_by_user=True,
|
||||
created_by=existing_memory.created_by,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user