Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: cleaning a thread should just clear out messages #4316

Merged
merged 2 commits into from
Dec 23, 2024

Conversation

louis-jan
Copy link
Contributor

@louis-jan louis-jan commented Dec 23, 2024

Describe Your Changes

  • Fixed an issue where the legacy implementation of thread cleaning no longer worked. Now, cleaning a thread clears messages and resets its metadata.

CleanShot 2024-12-23 at 11 38 43

Fixes Issues

Changes made

The code changes in the pull request include the following updates:

  1. extensions/conversational-extension/src/index.ts:

    • Reformatted the code for better readability by splitting a chained method call across multiple lines.
    • Changed the healthz method to be async.
  2. web/helpers/atoms/Thread.atom.ts:

    • Added a new atom createNewThreadAtom for creating a new thread and adding it to the thread list.
  3. web/hooks/useCreateNewThread.ts:

    • Removed the inline definition of createNewThreadAtom and imported it from Thread.atom.ts.
  4. web/hooks/useDeleteThread.test.ts:

    • Updated mock functions to reflect changes in the actual code.
    • Renamed mockDeleteThread to mockDeleteMessage and added mockModifyThread.
  5. web/hooks/useDeleteThread.ts:

    • Replaced the deletion of entire thread states with deletion of individual messages within threads.
    • Added logic to update thread metadata and use the modifyThread method instead of deleteThread.

These changes improve code organization, enhance readability, and adjust the logic for handling threads and messages.

@github-actions github-actions bot added the type: bug Something isn't working label Dec 23, 2024
Copy link
Contributor

github-actions bot commented Dec 23, 2024

Barecheck - Code coverage report

Total: 68.56%

Your code coverage diff: -0.03% ▾

Uncovered files and lines
FileLines
web/helpers/atoms/Thread.atom.ts90-93, 96, 110, 133, 135, 140-141, 144-145, 166-167, 172, 182-184, 188
web/hooks/useCreateNewThread.ts147-148, 150-151, 158-159, 170, 179, 214, 218, 220
web/hooks/useDeleteThread.ts68-69

Copy link
Contributor

This is the build for this pull request. You can download it from the Artifacts section here: Build URL.

@louis-jan louis-jan merged commit 2422267 into main Dec 23, 2024
9 checks passed
@louis-jan louis-jan deleted the fix/clean-thread-should-just-clear-out-messages branch December 23, 2024 05:35
@github-actions github-actions bot added this to the v0.5.12 milestone Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants