Files icon indicating copy to clipboard operation
Files copied to clipboard

Bug: Applying a tag to a folder will cause Files to crash

Open rospirit opened this issue 4 years ago • 7 comments

Description

Adding tags to folders causes the app to crash

Steps To Reproduce

  1. select a file.
  2. right click
  3. add a new tag
  4. observe that the app crashes

Steps to fix

  • Fix the crash

Files Version

2.3.11.0

Windows Version

10.0.22000.1042

Relevant Assets/Logs

https://user-images.githubusercontent.com/81501083/192501517-f06ccae0-4551-4fc3-99ef-09aa8246cb55.mp4

2022-09-23 23:55:09.2408|ERROR|AppUnhandledException|Index key must be less than 512 bytes.
	LiteDB.LiteException: Index key must be less than 512 bytes.
   at LiteDB.IndexService.AddNode(CollectionIndex, BsonValue, Byte, IndexNode) + 0x597
   at LiteDB.IndexService.AddNode(CollectionIndex, BsonValue, IndexNode) + 0x97
   at LiteDB.LiteEngine.<>c__DisplayClass17_0.<EnsureIndex>b__0(CollectionPage) + 0x286
   at LiteDB.LiteEngine.Transaction[T](String, Boolean, Func`2) + 0xe9
   at LiteDB.LiteEngine.EnsureIndex(String, String, String, Boolean) + 0x13c
   at LiteDB.LiteCollection`1.EnsureIndex(String, String, Boolean) + 0x47
   at LiteDB.LiteCollection`1.EnsureIndex[K](Expression`1, String, Boolean) + 0x72
   at Common.FileTagsDb.SetTags(String, Nullable`1, String[]) + 0x2be
   at Files.Uwp.Filesystem.ListedItem.set_FileTags(String[]) + 0x227
   at Files.Uwp.UserControls.Menus.FileTagsContextMenu.AddFileTag(IEnumerable`1, FileTagViewModel) + 0x1da
   at Files.Uwp.UserControls.Menus.FileTagsContextMenu.TagItem_Click(Object, RoutedEventArgs) + 0x6b
   at Microsoft.Toolkit.Uwp.UI.Controls.InAppNotificationOpeningEventHandler.Invoke(Object, InAppNotificationOpeningEventArgs) + 0x2e
   at __Interop.Intrinsics.HasThisCall__22[TArg0](Object, IntPtr, Object, TArg0) + 0x36
   at Files!<BaseAddress>+0x1454480
   at System.Runtime.InteropServices.McgMarshal.ThrowOnExternalCallFailed(Int32, RuntimeTypeHandle) + 0x21
   at __Interop.ComCallHelpers.Call(__ComObject, RuntimeTypeHandle, Int32) + 0xb8
   at __Interop.ForwardComStubs.Stub_10[TThis](__ComObject, Int32) + 0x24
   at Microsoft.AppCenter.Utils.ApplicationLifecycleHelper.<.ctor>b__17_1(Object, UnhandledErrorDetectedEventArgs) + 0x3d
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + 0x21
   at Microsoft.AppCenter.Utils.ApplicationLifecycleHelper.<.ctor>b__17_1(Object, UnhandledErrorDetectedEventArgs) + 0x75
   at System.EventHandler`1.Invoke(Object, TEventArgs) + 0x2e
   at __Interop.Intrinsics.HasThisCall__22[TArg0](Object, IntPtr, Object, TArg0) + 0x36
   at Files!<BaseAddress>+0x1454480

rospirit avatar Sep 23 '22 16:09 rospirit

You can export your settings including the tags in Files settings > about > import/export settings. Don't believe there is a way to download older versions.

Josh65-2201 avatar Sep 23 '22 16:09 Josh65-2201

Asking @yair100 for approval.

Josh65-2201 avatar Sep 27 '22 12:09 Josh65-2201

https://user-images.githubusercontent.com/81501083/192734083-244814db-2dbb-4117-8f62-ca891e46d48b.mp4

rospirit avatar Sep 28 '22 08:09 rospirit

@rospirit Files' DetailsLayout shows only one tag in that column. You have to remove other tags to see the latter

ferrariofilippo avatar Sep 29 '22 12:09 ferrariofilippo

Works fine for me.

Image

sthivaios avatar Oct 11 '22 17:10 sthivaios

Is this still an issue in the preview version? https://files.community/download/preview

yair100 avatar Oct 20 '22 04:10 yair100

Cannot reproduce on the Dev version nor Preview version of 2.3.57.

QuaintMako avatar Nov 02 '22 15:11 QuaintMako