Skip to content

Added new feature / fixed bug / updated code#1

Open
Mats914 wants to merge 3 commits intomainfrom
my-updates
Open

Added new feature / fixed bug / updated code#1
Mats914 wants to merge 3 commits intomainfrom
my-updates

Conversation

@Mats914
Copy link
Copy Markdown
Owner

@Mats914 Mats914 commented Feb 1, 2026

Note

Medium Risk
Moderate risk because it changes the app’s core message schema and runtime behavior (MongoDB connection/refresh loop) and adds new UI/state handling; failures could affect sending/displaying messages.

Overview
Enhances the Tkinter chat UI to support per-message usernames and timestamps, switching the message display to a scrollable read-only text area and adding basic window/layout improvements.

Adds input validation (empty/length-limited messages), stores username/timestamp alongside text in MongoDB, and improves resiliency with explicit MONGO_URI checks plus connection and send error dialogs; message refresh remains polling-based with a configurable interval.

Updates documentation with clearer install/usage/troubleshooting guidance and introduces a requirements.txt for dependency installation.

Written by Cursor Bugbot for commit 5bc1ee7. This will update automatically on new commits. Configure here.

@Mats914
Copy link
Copy Markdown
Owner Author

Mats914 commented Feb 1, 2026

2026-02-01

messages_collection = db["messages"]
if not mongo_uri:
messagebox.showerror("Settings Error", "MONGO_URI not found in .env file")
exit(1)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Messagebox called before Tk root window creation

Medium Severity

The messagebox.showerror() calls for missing MONGO_URI and MongoDB connection failures occur before root = tk.Tk() is created on line 39. This causes Tkinter to create an implicit hidden root window, which can result in focus issues on Windows, the error dialog appearing behind other windows, or a phantom blank window briefly appearing. Users may miss critical error messages explaining why the app won't start.

Additional Locations (1)

Fix in Cursor Fix in Web

messages = list(messages_collection.find().sort("_id"))
messages_text.config(state="normal")
messages_text.delete(1.0, tk.END)
messages_text.insert(tk.END, "Messages:\n\n")
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redundant "Messages:" header displayed twice

Low Severity

The "Messages:" header is displayed twice: once as a tk.Label on line 91 and again inserted into the ScrolledText on line 110 via messages_text.insert(tk.END, "Messages:\n\n"). Remove one of these redundant headers.

Fix in Cursor Fix in Web

send_button = tk.Button(root, text="Send", command=send_message)
send_button.pack(pady=10)
messages_container = tk.Frame(messages_frame)
messages_container.pack(fill="both", expand=True)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unnecessary wrapper frame adds no value

Low Severity

The messages_container frame only wraps messages_text and adds no value. The ScrolledText widget could be added directly to messages_frame, eliminating this unnecessary indirection.

Fix in Cursor Fix in Web

Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

"Connection Failed",
"Could not connect to MongoDB. Make sure MongoDB is running and the URI is correct.\n"
f"URI used: {mongo_uri}"
)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MongoDB URI with credentials exposed in error dialog

Medium Severity

The error message at line 31 displays the full mongo_uri in a dialog box with f"URI used: {mongo_uri}". The README explicitly instructs users to include credentials in Atlas connection strings (e.g., mongodb+srv://user:password@cluster...). This exposes database credentials in visible UI, risking exposure through screenshots shared for support, screen sharing sessions, or shoulder surfing.

Fix in Cursor Fix in Web

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.

1 participant