Skip to content

Commit f16b15a

Browse files
authored
Merge pull request #3379 from crowbartools/v5
5.65.2 Release
2 parents af0bd66 + 98187e4 commit f16b15a

File tree

16 files changed

+237
-62
lines changed

16 files changed

+237
-62
lines changed

.github/SUPPORT.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,10 @@
1+
## Support Policy
2+
3+
We will always support the latest stable Firebot release. Previous stable releases will be supported for **no more than 30 days** after a newer stable update has been released. After 30 days, you must be on a supported version in order to receive support via our official channels (Discord, GitHub, etc.).
4+
5+
Pre-release versions (e.g. betas) are no longer supported **immediately** upon a corresponding stable release or if superseded by a newer pre-release (e.g. `5.66.0-beta1` would immediately become unsupported upon release of either `5.66.0-beta2` or a `5.66.0` stable release). Nightly releases continue to receive limited support due to their potentially unstable nature.
6+
7+
18
### Need help or have a question?
9+
210
Please feel free to stop by our [Discord](https://discord.gg/crowbartools-372817064034959370) or connect with us on [Bluesky](https://bsky.app/profile/firebot.app)!

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "firebotv5",
3-
"version": "5.65.1",
3+
"version": "5.65.2",
44
"description": "Powerful all-in-one bot for Twitch streamers.",
55
"main": "build/main.js",
66
"scripts": {

src/backend/app-management/electron/window-management.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ const logger = require("../../logwrapper");
1515

1616
const EventEmitter = require("events");
1717

18+
const { copyDebugInfoToClipboard } = require("../../common/debug-info");
19+
1820
/**
1921
* Firebot's main window
2022
* Keeps a global reference of the window object, if you don't, the window will
@@ -196,6 +198,12 @@ async function createAppMenu() {
196198

197199
const overlayInstances = SettingsManager.getSetting("OverlayInstances");
198200

201+
/**
202+
* Steps to get new icon images:
203+
* - Select icon from https://pictogrammers.com/library/mdi/
204+
* - Do an Advanced PNG Export with 48x48 size and a white foreground
205+
*/
206+
199207
/**
200208
* @type {Electron.MenuItemConstructorOptions[]}
201209
*/
@@ -474,6 +482,16 @@ async function createAppMenu() {
474482
{
475483
type: 'separator'
476484
},
485+
{
486+
label: 'Copy Debug Info...',
487+
click: () => {
488+
copyDebugInfoToClipboard();
489+
},
490+
icon: await createIconImage("../../../gui/images/icons/mdi/bug-outline.png")
491+
},
492+
{
493+
type: 'separator'
494+
},
477495
{
478496
label: 'About Firebot...',
479497
click: () => {

src/backend/common/common-listeners.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ const { app, dialog, shell, autoUpdater } = require("electron");
44
const os = require('os');
55
const logger = require("../logwrapper");
66
const { restartApp } = require("../app-management/electron/app-helpers");
7+
const { copyDebugInfoToClipboard } = require("../common/debug-info");
78

89
function getLocalIpAddress() {
910
try {
@@ -136,4 +137,6 @@ exports.setupCommonListeners = () => {
136137

137138
autoUpdater.quitAndInstall();
138139
});
140+
141+
frontendCommunicator.on("copy-debug-info-to-clipboard", copyDebugInfoToClipboard);
139142
};

src/backend/common/debug-info.ts

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
2+
3+
import { app } from "electron";
4+
import os from "os";
5+
import frontendCommunicator from "./frontend-communicator";
6+
import ConnectionManager from "./connection-manager";
7+
import { AccountAccess } from "./account-access";
8+
import HttpServerManager from "../../server/http-server-manager";
9+
import WebsocketServerManager from "../../server/websocket-server-manager";
10+
import startupScriptsManager from "../common/handlers/custom-scripts/startup-scripts-manager";
11+
import { isConnected } from "../integrations/builtin/obs/obs-remote";
12+
13+
function getOsName(platform: NodeJS.Platform): string {
14+
if (platform === "darwin") {
15+
return "macOS";
16+
}
17+
18+
if (platform === "win32") {
19+
return "Windows";
20+
}
21+
22+
return "Linux";
23+
}
24+
25+
async function getDebugInfoString(): Promise<string> {
26+
const appVersion = app.getVersion();
27+
28+
const electronVersion = process.versions.electron ?? "unknown";
29+
const nodeVersion = process.versions.node ?? process.version;
30+
31+
const osName = getOsName(process.platform);
32+
const osVersion = typeof process.getSystemVersion === "function" ? process.getSystemVersion() : os.release();
33+
const osArch = os.arch();
34+
35+
const { locale } = Intl.DateTimeFormat().resolvedOptions();
36+
37+
const accounts = AccountAccess.getAccounts();
38+
const streamerLoggedIn = accounts.streamer.loggedIn ? "Yes" : "No";
39+
const botLoggedIn = accounts.bot.loggedIn ? "Yes" : "No";
40+
41+
const connectedToTwitch = ConnectionManager.chatIsConnected() ? "Connected" : "Disconnected";
42+
const connectedToOBS = isConnected() ? "Connected" : "Disconnected";
43+
44+
const httpServerStatus = HttpServerManager.isDefaultServerStarted ? "Running" : "Stopped";
45+
const websocketClients = WebsocketServerManager.getNumberOfOverlayClients();
46+
47+
const startupScripts = Object.values(startupScriptsManager.getLoadedStartupScripts());
48+
49+
return [
50+
"Firebot Debug Info",
51+
"------------------",
52+
`OS: ${osName} ${osVersion} (${osArch})`,
53+
`Firebot: ${appVersion}`,
54+
`Electron: ${electronVersion}`,
55+
`Node: ${nodeVersion}`,
56+
`Locale: ${locale}\n`,
57+
'Accounts:',
58+
` - Streamer: ${streamerLoggedIn}`,
59+
` - Bot: ${botLoggedIn}\n`,
60+
'Connections:',
61+
` - Twitch: ${connectedToTwitch}`,
62+
` - OBS: ${connectedToOBS}\n`,
63+
'Server:',
64+
` - HTTP Server: ${httpServerStatus}`,
65+
` - Overlay Clients: ${websocketClients}\n`,
66+
'Plugins:',
67+
startupScripts.length === 0
68+
? " - None"
69+
: startupScripts.map(script => ` - ${script.name}`).join("\n")
70+
].join("\n");
71+
}
72+
73+
export async function copyDebugInfoToClipboard() {
74+
const debugInfo = await getDebugInfoString();
75+
76+
frontendCommunicator.send("copy-to-clipboard", {
77+
text: debugInfo,
78+
toastMessage: "Debug information copied to clipboard"
79+
});
80+
}

src/backend/common/handlers/custom-scripts/startup-scripts-manager.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,10 @@ function getStartupScriptData(startupScriptDataId) {
9898
return startupScripts[startupScriptDataId];
9999
}
100100

101+
function getLoadedStartupScripts() {
102+
return { ...startupScripts };
103+
}
104+
101105
/**
102106
* Turns startup script data into valid Custom Script effects and runs them
103107
*/
@@ -123,4 +127,5 @@ frontendCommunicator.on("deleteStartupScriptData", (startupScriptDataId) => {
123127

124128
exports.runStartupScripts = runStartupScripts;
125129
exports.loadStartupConfig = loadStartupConfig;
126-
exports.getStartupScriptData = getStartupScriptData;
130+
exports.getStartupScriptData = getStartupScriptData;
131+
exports.getLoadedStartupScripts = getLoadedStartupScripts;

src/backend/common/profile-manager.ts

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { app } from "electron";
1+
import { app, dialog } from "electron";
22
import { JsonDB } from "node-json-db";
33
import fs from "fs";
44
import path from "path";
@@ -104,9 +104,17 @@ class ProfileManager {
104104
activeProfiles.push(profileId);
105105

106106
// Push our new profile to settings.
107-
globalSettingsDb.push("/profiles/activeProfiles", activeProfiles);
108-
globalSettingsDb.push("/profiles/loggedInProfile", profileId);
109-
logger.info(`New profile created: ${profileId}.${restart ? " Restarting." : ""}`);
107+
try {
108+
globalSettingsDb.push("/profiles/activeProfiles", activeProfiles);
109+
globalSettingsDb.push("/profiles/loggedInProfile", profileId);
110+
logger.info(`New profile created: ${profileId}.${restart ? " Restarting." : ""}`);
111+
} catch (error) {
112+
const errorMessage = (error as Error).name === "DatabaseError" ? error?.inner?.message ?? error.stack : error;
113+
logger.error(`Error saving ${profileId} profile to global settings. Is the file locked or corrupted?`, errorMessage);
114+
dialog.showErrorBox("Error Loading Profile", `An error occurred while trying to load your ${profileId} profile. Please try starting Firebot again. If this issue continues, please reach out on our Discord for support.`);
115+
app.quit();
116+
return;
117+
}
110118

111119
// Log the new profile in and (optionally) restart app.
112120
this.logInProfile(profileId, restart);

src/backend/common/settings-manager.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,9 @@ class SettingsManager extends EventEmitter {
139139
if (defaultValue !== undefined) {
140140
this.settingsCache[settingPath] = defaultValue;
141141
}
142-
if ((err as Error).name !== "DataError") {
142+
if ((err as Error).name === "DatabaseError") {
143+
logger.error(`Failed to read "${settingPath}" in global settings file. File may be corrupt.`, err?.inner?.message ?? err.stack);
144+
} else if ((err as Error).name !== "DataError") {
143145
logger.warn(err);
144146
}
145147
}

src/backend/effects/builtin/shoutout.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -357,8 +357,8 @@ const effect = {
357357
const boxArtId = `box-art-${uniqueId}`;
358358

359359
const shoutoutElement = `
360-
<div>
361-
<div id="${wrapperId}" class="firebot-shoutout-wrapper" style="background: linear-gradient(135deg, ${data.bgColor1} 0%, ${data.bgColor2} 100%); transform: scale(${scale});${data.zIndex ? ` position: relative; z-index: ${data.zIndex};` : ''}">
360+
<div style="scale: ${scale};">
361+
<div id="${wrapperId}" class="firebot-shoutout-wrapper" style="background: linear-gradient(135deg, ${data.bgColor1} 0%, ${data.bgColor2} 100%);${data.zIndex ? ` position: relative; z-index: ${data.zIndex};` : ''}">
362362
363363
<div style="position:relative;">
364364
<div id="${avatarWrapperId}" class="firebot-shoutout-avatar-wrapper firebot-shoutout-padding">

0 commit comments

Comments
 (0)