Richasy / Bili.Copilot

B站第三方 Windows 桌面客户端,使用 Windows App SDK 构建的原生高颜值应用
GNU General Public License v3.0
2.72k stars 67 forks source link

[Bug] 可能存在竞争的文件操作 #399

Closed CodeForCSharp closed 1 month ago

CodeForCSharp commented 4 months ago

Bug 描述

提示:另一个程序正在使用此文件,进程无法访问。

2024/05/13 01:23:08.667|Error|An exception occurred while the application was running|System.Runtime.InteropServices.COMException (0x80070020): 另一个程序正在使用此文件,进程无法访问。

正在使用此文件。请先关闭文件,然后再继续操作。
   at Bili.Copilot.Libs.Toolkit.FileToolkit.<>c__DisplayClass1_0`1.<<WriteLocalDataAsync>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at Bili.Copilot.Libs.Provider.HomeProvider.CachePartitionsAsync(IEnumerable`1 data)
   at Bili.Copilot.Libs.Provider.HomeProvider.GetVideoPartitionIndexAsync()
   at Bili.Copilot.ViewModels.SearchDetailViewModel.InitializeVideoFiltersAsync()
   at Bili.Copilot.ViewModels.SearchDetailViewModel.InitializeFiltersAsync(SearchModuleType type)
   at Bili.Copilot.ViewModels.SearchDetailViewModel.GetDataAsync()
   at Bili.Copilot.ViewModels.SearchDetailViewModel.SelectModuleAsync(SearchModuleItemViewModel vm)
   at CommunityToolkit.Mvvm.Input.AsyncRelayCommand.AwaitAndThrowIfFailed(Task executionTask)
   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__128_0(Object state)
   at Microsoft.UI.Dispatching.DispatcherQueueSynchronizationContext.<>c__DisplayClass2_0.<Post>b__0()
--- End of stack trace from previous location ---
   at WinRT.ExceptionHelpers.<ThrowExceptionForHR>g__Throw|39_0(Int32 hr)
   at ABI.Windows.ApplicationModel.Core.IUnhandledErrorMethods.Propagate(IObjectReference _obj)
   at Microsoft.AppCenter.Utils.ApplicationLifecycleHelperWinUI.<.ctor>b__0_3(Object sender, UnhandledErrorDetectedEventArgs eventArgs)
--- End of stack trace from previous location ---
   at Microsoft.AppCenter.Utils.ApplicationLifecycleHelperWinUI.<.ctor>b__0_3(Object sender, UnhandledErrorDetectedEventArgs eventArgs)
   at ABI.System.EventHandler`1.Do_Abi_Invoke[TAbi](Void* thisPtr, IntPtr sender, TAbi args)

复现问题的步骤

推荐页刷新

预期行为

不提示异常

截图

No response

应用来源

其它来源

No response

系统版本

其它系统版本

No response

运行设备

No response

日志记录

No response

备注

No response

人人为我,我为人人

我更擅长发现问题

Richasy commented 1 month ago

已修复