From dfce6760ca216f73931c58a1bc93ccf57f7d666e Mon Sep 17 00:00:00 2001 From: Natsumi Date: Sat, 24 Jan 2026 01:04:24 +1300 Subject: [PATCH] Fixes --- Dotnet/LogWatcher.cs | 26 ++++++++++++++++---------- Dotnet/WebApi.cs | 10 ++++++++-- src/shared/utils/common.js | 18 ++++++++++++------ src/stores/notification.js | 2 +- src/stores/settings/appearance.js | 2 +- src/views/Tools/Tools.vue | 2 ++ 6 files changed, 40 insertions(+), 20 deletions(-) diff --git a/Dotnet/LogWatcher.cs b/Dotnet/LogWatcher.cs index ee45c7d5..6b6e5eda 100644 --- a/Dotnet/LogWatcher.cs +++ b/Dotnet/LogWatcher.cs @@ -5,6 +5,7 @@ using System.Globalization; using System.IO; using System.Text; using System.Text.Json; +using System.Text.RegularExpressions; using System.Threading; using NLog; @@ -32,6 +33,7 @@ namespace VRCX private DateTime tillDate; public bool VrcClosedGracefully; private readonly ConcurrentQueue m_LogQueue = new ConcurrentQueue(); // for electron + private static readonly Regex CleanId = new("[^a-zA-Z0-9_\\-~:()]", RegexOptions.Compiled); // NOTE // FileSystemWatcher() is unreliable @@ -371,6 +373,7 @@ namespace VRCX return true; var location = line.Substring(lineOffset); + location = CleanId.Replace(location, string.Empty); AppendLog(new[] { @@ -447,7 +450,8 @@ namespace VRCX if (lineOffset >= line.Length) return true; - logContext.LocationDestination = line.Substring(lineOffset); + var locationDestination = line.Substring(lineOffset); + logContext.LocationDestination = CleanId.Replace(locationDestination, string.Empty); return true; } @@ -495,8 +499,8 @@ namespace VRCX fileInfo.Name, ConvertLogTimeToISO8601(line), "player-joined", - userInfo.DisplayName ?? string.Empty, - userInfo.UserId ?? string.Empty + userInfo.DisplayName, + userInfo.UserId }); return true; @@ -1351,14 +1355,15 @@ namespace VRCX var inventoryIdIndex = info.IndexOf("inv_", StringComparison.Ordinal); var inventoryId = info.Substring(inventoryIdIndex); + inventoryId = CleanId.Replace(inventoryId, string.Empty); AppendLog(new[] { fileInfo.Name, ConvertLogTimeToISO8601(line), "sticker-spawn", - userId ?? string.Empty, - displayName ?? string.Empty, + userId, + displayName, inventoryId }); @@ -1400,21 +1405,22 @@ namespace VRCX return new string[][] { }; } - private static (string? DisplayName, string? UserId) ParseUserInfo(string userInfo) + private static (string DisplayName, string UserId) ParseUserInfo(string userInfo) { - string? userDisplayName; - string? userId; + string userDisplayName; + string userId; - int pos = userInfo.LastIndexOf(" (", StringComparison.Ordinal); + var pos = userInfo.LastIndexOf(" (", StringComparison.Ordinal); if (pos >= 0) { userDisplayName = userInfo.Substring(0, pos); userId = userInfo.Substring(pos + 2, userInfo.LastIndexOf(')') - (pos + 2)); + userId = CleanId.Replace(userId, string.Empty); } else { userDisplayName = userInfo; - userId = null; + userId = string.Empty; } return (userDisplayName, userId); diff --git a/Dotnet/WebApi.cs b/Dotnet/WebApi.cs index d6219063..d3cad853 100644 --- a/Dotnet/WebApi.cs +++ b/Dotnet/WebApi.cs @@ -247,9 +247,15 @@ namespace VRCX public void SetCookies(string cookies) { - using (var stream = new MemoryStream(Convert.FromBase64String(cookies))) + try { - CookieContainer.Add(System.Text.Json.JsonSerializer.Deserialize(stream)); + using var stream = new MemoryStream(Convert.FromBase64String(cookies)); + var data = System.Text.Json.JsonSerializer.Deserialize(stream); + CookieContainer.Add(data); + } + catch (Exception e) + { + Logger.Error($"Failed to set cookies: {e.Message}"); } _cookieDirty = true; // force cookies to be saved for lastUserLoggedIn diff --git a/src/shared/utils/common.js b/src/shared/utils/common.js index 275e2da0..4d6786da 100644 --- a/src/shared/utils/common.js +++ b/src/shared/utils/common.js @@ -143,12 +143,18 @@ async function checkVRChatCache(ref) { return { Item1: -1, Item2: false, Item3: '' }; } - return AssetBundleManager.CheckVRChatCache( - id, - version, - variant, - variantVersion - ); + try { + return AssetBundleManager.CheckVRChatCache( + id, + version, + variant, + variantVersion + ); + } catch (err) { + console.error('Failed reading VRChat cache size:', err); + toast.error(`Failed reading VRChat cache size: ${err}`); + return { Item1: -1, Item2: false, Item3: '' }; + } } /** diff --git a/src/stores/notification.js b/src/stores/notification.js index 3207b644..646566b5 100644 --- a/src/stores/notification.js +++ b/src/stores/notification.js @@ -961,7 +961,7 @@ export const useNotificationStore = defineStore('Notification', () => { fileId, fileVersion ); - } else if (imageUrl) { + } else if (imageUrl && imageUrl.startsWith('http')) { fileVersion = imageUrl.split('/').pop(); // 1416226261.thumbnail-500.png fileId = fileVersion.split('.').shift(); // 1416226261 imageLocation = await AppApi.GetImage( diff --git a/src/stores/settings/appearance.js b/src/stores/settings/appearance.js index 86f58815..8a9b1ce3 100644 --- a/src/stores/settings/appearance.js +++ b/src/stores/settings/appearance.js @@ -211,7 +211,7 @@ export const useAppearanceSettingsStore = defineStore( JSON.stringify(TRUST_COLOR_DEFAULTS) ), configRepository.getBool('VRCX_notificationIconDot', true), - configRepository.getBool('VRCX_navIsCollapsed', true), + configRepository.getBool('VRCX_navIsCollapsed', false), configRepository.getBool('VRCX_dataTableStriped', false), configRepository.getBool('VRCX_showPointerOnHover', false), configRepository.getString( diff --git a/src/views/Tools/Tools.vue b/src/views/Tools/Tools.vue index 49cc7df3..86a28dab 100644 --- a/src/views/Tools/Tools.vue +++ b/src/views/Tools/Tools.vue @@ -296,6 +296,7 @@ + @@ -332,6 +333,7 @@ const ExportDiscordNamesDialog = defineAsyncComponent(() => import('./dialogs/ExportDiscordNamesDialog.vue')); const ExportFriendsListDialog = defineAsyncComponent(() => import('./dialogs/ExportFriendsListDialog.vue')); const ExportAvatarsListDialog = defineAsyncComponent(() => import('./dialogs/ExportAvatarsListDialog.vue')); + const RegistryBackupDialog = defineAsyncComponent(() => import('../Settings/dialogs/RegistryBackupDialog.vue')); const { t } = useI18n(); const router = useRouter();