Skip to content
This repository was archived by the owner on Jul 22, 2025. It is now read-only.

Conversation

@SamSaffron
Copy link
Member

@SamSaffron SamSaffron commented May 1, 2025

This PR addresses a bug where uploads weren't being cleared after successfully posting a new private message in the AI bot conversations interface. Here's what the changes do:

Main Fix:

  • Makes the prepareAndSubmitToBot() method async and adds proper error handling
  • Adds this.uploads.clear() after successful submission to clear all uploads
  • Adds a test to verify that the "New Question" button properly resets the UI with no uploads

Additional Improvements:

  1. Dynamic Character Length Validation:

    • Uses siteSettings.min_personal_message_post_length instead of hardcoded 10 characters
    • Updates the error message to show the dynamic character count
    • Adds proper pluralization in the localization file for the error message
  2. Bug Fixes:

    • Adds null checks with optional chaining (link?.topic?.id) in the sidebar code to prevent potential errors
  3. Code Organization:

    • Moves error handling from the service to the controller for better separation of concerns

@SamSaffron SamSaffron merged commit 3800728 into main May 2, 2025
6 checks passed
@SamSaffron SamSaffron deleted the remove-uploads branch May 2, 2025 03:46
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants