Skip to content

Ceara/aitt fix new thread behavior #67866

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

Merged
merged 2 commits into from
Aug 22, 2025

Conversation

cearachew
Copy link
Contributor

This is a fix for a bug @MollyPeredo noted where you couldn't create a new thread using the "New thread" button if you are still in a thread started with the new thread button.

This is because we previously set the key for the chat component as 0 for a new thread and the thread id for old threads. We set the key when switching threads to re-set the State of the chat component to clear the message history and reset it from params. On a new thread with key == 0, we don't reset the key to the newly created threadID because we want to keep the messagehistory and view as-is. The key remained until switching threads from the sidebar, which cause problems when trying to create a new thread from a previous new thread, because both keys are 0.

This change just alternates 0 and -1 as keys for new threads. -1 is used so it won't accidentally clash with a real thread ID.

Video:

Screen.Recording.2025-08-20.at.7.13.33.PM.mov

Links

slack thread about bug: https://codedotorg.slack.com/archives/C050HE4QDHR/p1755200424919449?thread_ts=1755196263.126769&cid=C050HE4QDHR
Included in jira ticket: https://codedotorg.atlassian.net/browse/AITT-1115

Testing story

Previous non-thread tests are passing

  • Tests provide adequate coverage
  • Privacy impacts have been documented
  • Security impacts have been documented
  • Code is well-commented
  • New features are translatable or updates will not break translations
  • Relevant documentation has been added or updated
  • User impact is well-understood and desirable
  • Follow-up work items (including potential tech debt) are tracked and linked

@cearachew cearachew requested a review from lfryemason August 20, 2025 23:27
@cearachew cearachew merged commit 92651d0 into staging Aug 22, 2025
6 checks passed
@cearachew cearachew deleted the ceara/AITT-fix-new-thread-behavior branch August 22, 2025 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants