cinderblocks / libremetaverse

An fork of the libopenmetaverse library striving for performance improvements and up-to-date compatibility with SL/OS/Halcyon
BSD 3-Clause "New" or "Revised" License
60 stars 40 forks source link

client.Inventory.RemoveFolder fails #63

Closed Jercieblue closed 2 years ago

Jercieblue commented 2 years ago

Dear Sirs and friends, I am trying to delete a folder from the root directory and seems that the folders still remains while the CreateFolder works perfect

Dim test_folder As String = "RoboBuddy Received Items" Dim items As New List(Of KeyValuePair(Of UUID, InventoryNode)) For Each item In client.Inventory.Store.Items If item.Value.ToString() = test_folder Then items.Add(item) End If Next

For Each item In items client.Inventory.RemoveFolder(item.Key) Next

in the above code what i am doing is i passing each pair into a new list and then removing each uuid from the store to avoid list collection modification change.

Do i need to do anything additional?

Best regards

cinderblocks commented 2 years ago

I'm not sure why you are trying to do it this way. If you are trying to remove a Node why not simply use Inventory.RemoveNodeFor(InventoryBase) or Inventory.RemoveDescendants(UUID) or Inventory.Remove(List<UUID> items, List<UUID> folders)? You can't use a folder removal function to remove inventory items.

Jercieblue commented 2 years ago

i want to remove the folder itself, is empty, also i am doing this way only not modify the underlaying list. it still fails even if i try to remove a single empty directory. It does remove it from the store list, but seems there is a problem updating the server so when you relog, the folder is still there. Thats why i am asking if there is any manual update i need to do or it is suposed to update.

In your code i see you send the packet so is strange, if you can try to reproduce it let me know

cinderblocks commented 2 years ago

Viewers don't typically remove folders from the inventory service like that. They move them to Trash.

Jercieblue commented 2 years ago

https://prnt.sc/26i6k8d

Not in trash either, they are there.

cinderblocks commented 2 years ago

RemoveFolder() doesn't move nodes to Trash. It appears Remove() and RemoveFolder() were never updated for AIS so this is a bug.

cinderblocks commented 2 years ago

Fixed in 1.9.19