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

bug: A broken thread.json could break the entire thread list #3693

Closed
3 tasks done
louis-jan opened this issue Sep 18, 2024 · 1 comment
Closed
3 tasks done

bug: A broken thread.json could break the entire thread list #3693

louis-jan opened this issue Sep 18, 2024 · 1 comment
Assignees
Labels
category: threads & chat Threads & chat UI UX issues P1: important Important feature / fix type: bug Something isn't working

Comments

@louis-jan
Copy link
Contributor

louis-jan commented Sep 18, 2024

Jan version

0.5.4

Describe the Bug

When the thread.json file is corrupted or contains invalid JSON, it causes the entire thread list to become inaccessible (empty list). This issue is critical as it disrupts the user experience by preventing access to all threads.

Please refer to the discussion for more context:
https://discord.com/channels/1107178041848909847/1285798898161418260

Expected Behavior

The application should handle the corrupted thread.json gracefully. It should either:

  1. Skip the corrupted entries and continue to load the rest of the threads.
  2. Display an error message indicating the issue with the specific file, without crashing the entire thread list.

Actual Behavior

The application fails to load any threads, displaying an error or crashing due to the corrupted thread.json.

Possible Solution

Implement error handling for JSON parsing in the thread loading functionality. Ensure that:

The application can detect and skip over corrupted JSON entries.
A user-friendly error message is displayed, indicating the problem with the thread.json file.

Steps to Reproduce

  1. Create a thread
  2. Manually edit the JSON, remove any comma
  3. Save the corrupted file.
  4. Attempt to load the thread list in the application (by pressing Ctrl + Shift + R)

Screenshots / Logs

No response

What is your OS?

  • MacOS
  • Windows
  • Linux
@louis-jan louis-jan added the type: bug Something isn't working label Sep 18, 2024
@louis-jan louis-jan self-assigned this Sep 18, 2024
@louis-jan louis-jan added this to the v0.5.5 milestone Sep 18, 2024
@imtuyethan imtuyethan added P1: important Important feature / fix category: threads & chat Threads & chat UI UX issues labels Sep 18, 2024
@imtuyethan
Copy link
Contributor

imtuyethan commented Oct 1, 2024

I tested it on my Mac; the error handling is much better now.
When i tried to edit the threads json file, it changed the entire JSON file to red as error warning.
When I got back to threads & hit Ctrl + Shift + R, the previous threads that I edited the JSON file were gone.

Screenshot 2024-10-01 at 9 39 14 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: threads & chat Threads & chat UI UX issues P1: important Important feature / fix type: bug Something isn't working
Projects
Archived in project
Development

No branches or pull requests

2 participants