Skip to content

fix: delete steps and elements on message edit#2915

Open
Allaoua9 wants to merge 6 commits intoChainlit:mainfrom
Allaoua9:fix/reset-steps-message-edit-al
Open

fix: delete steps and elements on message edit#2915
Allaoua9 wants to merge 6 commits intoChainlit:mainfrom
Allaoua9:fix/reset-steps-message-edit-al

Conversation

@Allaoua9
Copy link
Copy Markdown
Contributor

Problem

When a user edits a message, child steps and elements from previous executions were never deleted from the data layer. This caused all historical steps to accumulate and reappear in the UI after each edit.

This is based on this PR .

cc @hayescode this PR addresses your concern on orphaned Elements and Feedbacks.

@dosubot dosubot Bot added size:M This PR changes 30-99 lines, ignoring generated files. bug Something isn't working unit-tests Has unit tests. labels Apr 30, 2026
@Allaoua9
Copy link
Copy Markdown
Contributor Author

PR 2856 should be closed in favor of this.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 issues found across 3 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="backend/tests/test_message.py">

<violation number="1" location="backend/tests/test_message.py:897">
P2: This assertion is too loose and can miss extra delete_* calls, so the test may not catch over-deletion regressions.</violation>

<violation number="2" location="backend/tests/test_message.py:897">
P2: Deletion tests check async data-layer calls with call assertions instead of await assertions, so they would miss a missing-`await` regression.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Comment thread backend/tests/test_message.py Outdated
Comment thread backend/tests/test_message.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working size:M This PR changes 30-99 lines, ignoring generated files. unit-tests Has unit tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant