Browser crash message, mutual friends message

This commit is contained in:
Natsumi
2025-12-30 15:36:45 +13:00
parent c49635561c
commit 5e9dcfbd3f
6 changed files with 63 additions and 30 deletions

View File

@@ -69,28 +69,17 @@ namespace VRCX
public void OnRenderProcessTerminated(IWebBrowser chromiumWebBrowser, IBrowser browser, CefTerminationStatus status,
int errorCode, string errorMessage)
{
switch (status)
var message = status switch
{
case CefTerminationStatus.AbnormalTermination:
_logger.Error("Browser terminated abnormally.");
break;
case CefTerminationStatus.ProcessWasKilled:
_logger.Error("Browser was killed.");
break;
case CefTerminationStatus.ProcessCrashed:
_logger.Error("Browser crashed.");
break;
case CefTerminationStatus.OutOfMemory:
_logger.Error("Browser out of memory.");
break;
default:
_logger.Error($"Browser terminated with unhandled status '{status}' while at address.");
break;
}
CefTerminationStatus.AbnormalTermination => "Browser terminated abnormally.",
CefTerminationStatus.ProcessWasKilled => "Browser was killed.",
CefTerminationStatus.ProcessCrashed => "Browser crashed.",
CefTerminationStatus.OutOfMemory => "Browser out of memory.",
_ => $"Browser terminated with unhandled status code '{status}'"
};
_logger.Error("Render process terminated: {Message} ErrorCode: {ErrorCode} ErrorMessage: {ErrorMessage}",
message, errorCode, errorMessage);
StartupArgs.LaunchArguments.LaunchCommand = $"crash/{message}";
if (chromiumWebBrowser.IsDisposed || chromiumWebBrowser.IsLoading)
return;

View File

@@ -43,6 +43,7 @@ namespace VRCX
this.TrayMenu = new ContextMenuStrip(this.components);
this.TrayMenu_Open = new ToolStripMenuItem();
this.TrayMenu_DevTools = new ToolStripMenuItem();
this.TrayMenu_ForceCrash = new ToolStripMenuItem();
this.TrayMenu_Separator = new ToolStripSeparator();
this.TrayMenu_Quit = new ToolStripMenuItem();
this.TrayIcon = new NotifyIcon(this.components);
@@ -53,13 +54,13 @@ namespace VRCX
//
// TrayMenu
//
this.TrayMenu.Items.AddRange(new ToolStripItem[]
{
this.TrayMenu_Open,
this.TrayMenu_DevTools,
this.TrayMenu_Separator,
this.TrayMenu_Quit
});
this.TrayMenu.Items.Add(this.TrayMenu_Open);
this.TrayMenu.Items.Add(this.TrayMenu_DevTools);
if (Program.LaunchDebug)
this.TrayMenu.Items.Add(this.TrayMenu_ForceCrash);
this.TrayMenu.Items.Add(this.TrayMenu_Separator);
this.TrayMenu.Items.Add(this.TrayMenu_Quit);
this.TrayMenu.Name = "TrayMenu";
this.TrayMenu.Size = new Size(132, 54);
//
@@ -77,6 +78,13 @@ namespace VRCX
this.TrayMenu_DevTools.Text = "DevTools";
this.TrayMenu_DevTools.Click += new EventHandler(this.TrayMenu_DevTools_Click);
//
// TrayMenu_ForceCrash
//
this.TrayMenu_ForceCrash.Name = "TrayMenu_ForceCrash";
this.TrayMenu_ForceCrash.Size = new Size(131, 22);
this.TrayMenu_ForceCrash.Text = "Force Crash";
this.TrayMenu_ForceCrash.Click += new EventHandler(this.TrayMenu_ForceCrash_Click);
//
// TrayMenu_Separator
//
this.TrayMenu_Separator.Name = "TrayMenu_Separator";
@@ -119,6 +127,7 @@ namespace VRCX
private ContextMenuStrip TrayMenu;
private ToolStripMenuItem TrayMenu_Open;
private ToolStripMenuItem TrayMenu_DevTools;
private ToolStripMenuItem TrayMenu_ForceCrash;
private ToolStripSeparator TrayMenu_Separator;
private ToolStripMenuItem TrayMenu_Quit;
private NotifyIcon TrayIcon;

View File

@@ -243,6 +243,11 @@ namespace VRCX
{
Instance.Browser.ShowDevTools();
}
private void TrayMenu_ForceCrash_Click(object sender, System.EventArgs e)
{
Instance.Browser.LoadUrl("chrome://crash");
}
private void TrayMenu_Quit_Click(object sender, System.EventArgs e)
{

View File

@@ -584,6 +584,20 @@
</el-dropdown>
</div>
</div>
<div
v-if="mutualFriendsError"
@click="openExternalLink('https://docs.vrchat.com/docs/vrchat-202542#mutuals')"
style="
margin-top: 20px;
display: flex;
justify-content: center;
align-items: center;
color: #f56c6c;
cursor: pointer;
">
<el-icon style="margin-right: 5px"><Warning /></el-icon>
<span>Mutual Friends unavailable due to VRChat staged rollout, click for more info</span>
</div>
<ul
class="x-friend-list"
style="margin-top: 10px; overflow: auto; max-height: 250px; min-width: 130px">
@@ -1536,6 +1550,7 @@
const isEditNoteAndMemoDialogVisible = ref(false);
const vrchatCredit = ref(null);
const mutualFriendsError = ref(false);
const userDialogAvatars = computed(() => {
const { avatars, avatarReleaseStatus } = userDialog.value;
@@ -2222,6 +2237,7 @@
const mutualIds = userDialog.value.mutualFriends.map((u) => u.id);
database.updateMutualsForFriend(userId, mutualIds);
}
mutualFriendsError.value = !success;
}
});
}

View File

@@ -1964,6 +1964,9 @@
"screenshot_metadata": {
"deleted": "Screenshot metadata deleted",
"delete_failed": "Failed to delete screenshot metadata"
},
"crash": {
"vrcx_crash": "VRCX has recovered from a crash."
}
},
"prompt": {

View File

@@ -525,11 +525,22 @@ export const useVrcxStore = defineStore('Vrcx', () => {
async function startupLaunchCommand() {
const command = await AppApi.GetLaunchCommand();
if (command) {
eventLaunchCommand(command);
if (!command) {
return;
}
if (command.startsWith('crash/')) {
const crashMessage = command.replace('crash/', '');
console.error('VRCX recovered from crash:', crashMessage);
ElMessageBox.alert(
crashMessage,
t('message.crash.vrcx_crash')
).catch(() => {});
return;
}
eventLaunchCommand(command);
}
// called from C#
function eventLaunchCommand(input) {
if (!watchState.isLoggedIn) {
return;