Skip to content

📝 fix: Properly Restore Draft Text When Switching Conversations#12384

Merged
danny-avila merged 1 commit into
danny-avila:devfrom
newjersey:dlew/fix-clear-draft
Apr 3, 2026
Merged

📝 fix: Properly Restore Draft Text When Switching Conversations#12384
danny-avila merged 1 commit into
danny-avila:devfrom
newjersey:dlew/fix-clear-draft

Conversation

@dlew

@dlew dlew commented Mar 24, 2026

Copy link
Copy Markdown
Contributor

Summary

Right now, if you have draft text in conversation A, but no draft text in conversation B, then switching from A -> B inserts the draft from A into B (oops).

This was caused by a bug in the restoreText() logic which did not restore blank text as the saved draft.

Now, it'll always restore whatever is found as a draft (or set to blank if there is no draft).

Change Type

  • Bug fix (non-breaking change which fixes an issue)

Testing

I tested within the app, switching between conversations a bunch (with or without drafts).

I also added some unit tests for useAutoSave() to verify the draft saves/restores.

Checklist

Please delete any irrelevant options.

  • My code adheres to this project's style guidelines
  • I have performed a self-review of my own code
  • My changes do not introduce new warnings
  • I have written tests demonstrating that my changes are effective or that my feature works
  • Local unit tests pass with my changes

Right now, if you have draft text in conversation A, but no draft text in
conversation B, then switching from A -> B inserts the draft from A into B
(oops).

This was caused by a bug in the `restoreText()` logic which did not
restore *blank* text as the saved draft.

Now, it'll always restore whatever is found as a draft (or set to blank if
there is no draft).
@danny-avila danny-avila changed the title fix: properly restore draft text when switching convos 📝 fix: Properly Restore Draft Text When Switching Conversations Apr 3, 2026
@danny-avila
danny-avila merged commit 162ac9c into danny-avila:dev Apr 3, 2026
7 checks passed
@dlew
dlew deleted the dlew/fix-clear-draft branch April 7, 2026 18:16
yidianyiko pushed a commit to yidianyiko/LibreChat that referenced this pull request Apr 13, 2026
…y-avila#12384)

Right now, if you have draft text in conversation A, but no draft text in
conversation B, then switching from A -> B inserts the draft from A into B
(oops).

This was caused by a bug in the `restoreText()` logic which did not
restore *blank* text as the saved draft.

Now, it'll always restore whatever is found as a draft (or set to blank if
there is no draft).
jcbartle pushed a commit to jcbartle/LibreChat that referenced this pull request May 11, 2026
…y-avila#12384)

Right now, if you have draft text in conversation A, but no draft text in
conversation B, then switching from A -> B inserts the draft from A into B
(oops).

This was caused by a bug in the `restoreText()` logic which did not
restore *blank* text as the saved draft.

Now, it'll always restore whatever is found as a draft (or set to blank if
there is no draft).
ThomasVuNguyen pushed a commit to ThomasVuNguyen/LibreChat that referenced this pull request Jul 15, 2026
…y-avila#12384)

Right now, if you have draft text in conversation A, but no draft text in
conversation B, then switching from A -> B inserts the draft from A into B
(oops).

This was caused by a bug in the `restoreText()` logic which did not
restore *blank* text as the saved draft.

Now, it'll always restore whatever is found as a draft (or set to blank if
there is no draft).
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