Refined Storage

Refined Storage

77M Downloads

Portable grid stops working from inventory

HueboWasTaken opened this issue ยท 8 comments

commented

Issue description:

Portable grid retains data of every item that passes through it, even items that are no longer in it and with the storage disk removed. This causes an invalid packet buffer error and prevents the portable grid from being opened from the inventory.
same issue as #2378, but wanted to add that the NBT data of items is retained even after those items are removed from the grid.

What happens:

Portable grid cannot be opened from inventory.

What you expected to happen:

Portable grid can be opened from inventory.

Steps to reproduce:

  1. Fill portable grid with random things
  2. Use for a while
  3. Grid will no longer open from inventory
    ...

Version (make sure you are on the latest version before reporting):

  • Minecraft: 1.16.4
  • Forge: 35.1.4
  • Refined Storage: 1.9.9

Does this issue occur on a server? [yes/no]
yes

commented

Portable grid retains data of every item that passes through it, even items that are no longer in it and with the storage disk removed.

I don't really understand this, can you clarify? Especially the "retains" part is not clear.

This causes an invalid packet buffer error and prevents the portable grid from being opened from the inventory.

You made a conclusion here that I can't verify. Where is the invalid packet buffer error?

Please refrain from making actual conclusions about the problem. Of course you can state it if it's helpful, but don't let it obscure the bug report.

commented

Portable grid retains data of every item that passes through it, even items that are no longer in it and with the storage disk removed.

I don't really understand this, can you clarify? Especially the "retains" part is not clear.

This causes an invalid packet buffer error and prevents the portable grid from being opened from the inventory.

You made a conclusion here that I can't verify. Where is the invalid packet buffer error?

Please refrain from making actual conclusions about the problem. Of course you can state it if it's helpful, but don't let it obscure the bug report.

I forgot about this sorry, I didn't mean to make a conclusion, just a thought.

Hovering over the portable grid and holding shift in your inventory to show the NBT data, the NBT data of items that aren't in the portable grid anymore is shown, so it gets bigger and bigger with each item that passes through the grid - I'm not sure if this is actually causing the issue but it seemed strange to me.

The invalid packet error is printed in the server console when trying to open the portable grid from your inventory.

commented

I have also had this problem. Unable to open the portable grid from my hand, but able to if I set it down in world. I created another portable grid and moved the drive from the old one to the new one and was able to open it from my hand.

Here is the NBT data from the newly create portable grid

Here is the NBT data from the old one that wouldn't open from my hand

commented

This appears to be caused by the StorageTracker tag on the grid. Apparently portable grids store their "last modified" info in the item's NBT data. So any portable grid will eventually get this way, because it just keeps accumulating tracking information. I think the only fixes for this is to start storing the information somewhere else, or truncate the data if it gets too large, or stop tracking it for portable grids entirely.

I'm guessing that the reason it's tracked in the first place is so that portable grids that are placed in the world can be monitored. (But it's not very useful for grids you never put down, since it's only tracking you. EDIT: Actually, it's useful for the "Last Modified" sort mode.)

As a workaround, you can remove the disk by placing the grid in the world, then putting it in a new portable grid. Not great, but you don't lose anything but the grid. (I just spawned a new one in.)

You can avoid/delay the issue by not putting items with lots of NBT data in your portable grid. (Heavily enchanted items, an Akashic Tome, backpacks, trapped mobs, etc. ) I think removing/reinserting the same item is fine, but if it's changed at all, like your pickaxe is damaged, it counts as a new item.

commented

https://pastebin.com/xfzWeWB4
Here's a log piece for what happens when you try to open one of these portable grids with too much NBT

commented

Still an issue, works for a while then stops working.

Personally would like a toggle to turn off the item tracking, because I don't really see a need for that, and that would be the easiest way for this issue to be fixed.

The portable grid is too useful. I hope this gets fixed soon. :(

commented

@raoulvdberge
Give portable grids an id and write this into a file?

Or ... do we even need a tracker for Portable grids?

Guess we would also make sure to remove old entries so it stays below a certain size.

commented

I would decouple the storage tracker instances from the portable grid itself, storing it separate like disk IDs.