Skip to content

Improve stability and error handling across auth, main, and accounts logic#1

Open
krlaskidata wants to merge 2 commits into
techichrism:mainfrom
krlaskidata:main
Open

Improve stability and error handling across auth, main, and accounts logic#1
krlaskidata wants to merge 2 commits into
techichrism:mainfrom
krlaskidata:main

Conversation

@krlaskidata
Copy link
Copy Markdown

Summary

This PR improves stability, error handling, and overall robustness across multiple parts of the application, mainly focusing on authentication, window communication, and account handling.


Key Changes

🔐 Authentication (auth-service.js)

  • Enabled TLS verification (rejectUnauthorized: true) to improve security and prevent potential MITM risks
  • Added missing console.warn fallback for unencrypted credential handling to improve visibility during debugging

🧠 Core Logic (main.js)

  • Introduced a centralized sendToWindow(channel, ...args) helper to reduce duplicated logic
  • Added proper safety checks (mainWindow && !mainWindow.isDestroyed()) before sending events
    → prevents crashes when windows close during async operations
  • Replaced empty .catch() blocks with proper logging (console.warn)
    → improves debugging and avoids silent failures
  • Extracted reusable resolveAccountCookies(accountId) logic to eliminate duplication across:
    • resolveLiveAuthTokens
    • scanAllAccountRegions
    • copy-cloud-settings

⚡ UI / Accounts (App.jsx)

  • Optimized refreshAccountRanks:
    • Now filters only accounts with status === 'running'
    • Reduces unnecessary polling every 15 seconds
    • Improves performance for setups with multiple accounts

@krlaskidata
Copy link
Copy Markdown
Author

Let me know what you think 🙂

I focused mainly on stability, removing duplication, and improving error visibility. I'm open to feedback or changes if something doesn't fit your expectations.
``

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