Skip to content

Development#31

Merged
pladisdev merged 65 commits intomainfrom
development
Nov 25, 2025
Merged

Development#31
pladisdev merged 65 commits intomainfrom
development

Conversation

@pladisdev
Copy link
Owner

No description provided.

pladisdev and others added 30 commits November 2, 2025 09:42
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: pladisdev <127021507+pladisdev@users.noreply.github.com>
Co-authored-by: pladisdev <127021507+pladisdev@users.noreply.github.com>
Co-authored-by: pladisdev <127021507+pladisdev@users.noreply.github.com>
Co-authored-by: pladisdev <127021507+pladisdev@users.noreply.github.com>
Co-authored-by: pladisdev <127021507+pladisdev@users.noreply.github.com>
…4b50-93c4-0e11b13594f4

Clarify error handler ordering is correct - no changes needed
Co-authored-by: pladisdev <127021507+pladisdev@users.noreply.github.com>
Co-authored-by: pladisdev <127021507+pladisdev@users.noreply.github.com>
…47b6-b204-5bf8892748d3

Extract magic numbers to named constants in audio playback code
…4606-8149-97ceaa22873d

Use platform.system() instead of sys.platform for OS detection
Extract duplicated hex opacity calculation to utility function
Extract avatar active offset magic number into configurable setting
Fix audio reference cleanup on play() failure in popup mode
Fix race condition in popup avatar lifecycle
Copilot AI review requested due to automatic review settings November 25, 2025 21:21
@pladisdev pladisdev merged commit db6ddbe into main Nov 25, 2025
10 of 13 checks passed
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request represents a development release (v1.3.1) that includes important refactoring and bug fixes. The changes focus on improving code organization by moving queue management to a dedicated module, enhancing settings loading to support backward compatibility with new defaults, and adding defensive checks in the frontend.

Key changes:

  • Refactored queue imports to use modules.queue_manager instead of importing from app, reducing circular dependencies
  • Enhanced get_settings() to merge database settings with defaults, ensuring new settings are available even in older databases
  • Added defensive undefined check in frontend settings to prevent edge cases with uninitialized values

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
backend/version.py Bumped version from 1.3.0 to 1.3.1
backend/modules/persistent_data.py Added settings merge logic to combine defaults with database settings for backward compatibility
backend/routers/system.py Refactored to import parallel_message_queue from queue_manager instead of app
backend/routers/config_backup.py Refactored to import avatar_message_queue from queue_manager instead of app
backend/routers/avatars.py Refactored multiple imports to use avatar_message_queue from queue_manager instead of app
backend/tests/test_clearchat.py Added fixture to mock Twitch credentials for all tests in the class; added os import
frontend/src/components/settings/GeneralSettings.jsx Added undefined check for parallelMessageLimit to prevent edge cases
Comments suppressed due to low confidence (1)

backend/tests/test_clearchat.py:7

  • Import of 'os' is not used.
import os

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.

"""
import pytest
import asyncio
import os
Copy link

Copilot AI Nov 25, 2025

Choose a reason for hiding this comment

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

The os import appears to be unused. The monkeypatch.setenv method in the fixture doesn't require the os module to be imported directly. Consider removing this import to keep the code clean.

Suggested change
import os

Copilot uses AI. Check for mistakes.
settings = json.loads(row.value_json)
# Merge defaults with loaded settings (settings take precedence)
# This ensures new settings are available even in old databases
merged = {**defaults, **settings}
Copy link

Copilot AI Nov 25, 2025

Choose a reason for hiding this comment

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

The shallow merge strategy {**defaults, **settings} may not properly handle nested settings dictionaries. For example, if a new nested key is added to tts.monstertts in defaults but the database already has a tts object, the nested default keys won't be merged - the entire database tts object will override the defaults. Consider using a deep merge function to ensure nested settings defaults are properly merged.

Copilot uses AI. Check for mistakes.
Comment on lines +92 to +109
# Load defaults
defaults = {}
if os.path.exists(DEFAULTS_PATH):
with open(DEFAULTS_PATH, 'r', encoding='utf-8') as f:
defaults = json.load(f)

with Session(engine) as session:
row = session.exec(select(Setting).where(Setting.key == "settings")).first()
if row:
settings = json.loads(row.value_json)
# Merge defaults with loaded settings (settings take precedence)
# This ensures new settings are available even in old databases
merged = {**defaults, **settings}
logger.info(f"Loaded settings from database: {DB_PATH}")
return settings
return merged
else:
logger.error("No settings found in database!")
return {}
return defaults
Copy link

Copilot AI Nov 25, 2025

Choose a reason for hiding this comment

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

The new settings merge logic lacks test coverage. Consider adding tests to verify:

  1. Settings are properly merged when database has old settings without new defaults
  2. Nested settings dictionaries are correctly merged (or add a deep merge if the shallow merge is insufficient)
  3. Database settings take precedence over defaults
  4. Defaults are returned when no database settings exist

Copilot uses AI. Check for mistakes.
@github-actions
Copy link

✅ Windows Build Successful

Executable: ChatYapper.exe (68.31 MB)
MSI Installer: ChatYapper-1.3.1.msi (67.65 MB)
App Version: 1.3.1
Build ID: build-v1.3.1-2025.11.25-aa89194
Commit: aa89194

Build Status

  • ✅ Windows executable & MSI installer
  • 🔄 Linux build (check separate job)
  • 🔄 Docker image (check separate job)

Download the artifacts from the workflow run to test before merging.

Once merged to main, an official release will be created automatically with tag v1.3.1.

@github-actions
Copy link

🐳 Docker Image Built Successfully

Image: ghcr.io/pladisdev/chat-yapper:pr-aa89194
Tag: pr-aa89194

Test this PR with Docker:

docker pull ghcr.io/pladisdev/chat-yapper:pr-aa89194

docker run -d \
  --name chat-yapper-pr \
  -p 8069:8008 \
  -e TWITCH_CLIENT_ID=your_id \
  -e TWITCH_CLIENT_SECRET=your_secret \
  ghcr.io/pladisdev/chat-yapper:pr-aa89194

Access at: http://localhost:8069

The Docker image will be published to the GitHub Container Registry when merged to main.

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.

3 participants