Closed ApocalypsjeNL closed 3 months ago
Ah yeah. I see what's happening.
If editCurrentInventory
can't resolve an online or networked user, it fetches their latest snapshot from the database (as it should). The issue is, I forgot that since editCurrentInventory
for an online/networked user creates a new snapshot to reflect their absolute latest changes and fetching the latest snapshot doesn't, it's attempting to add a snapshot with the same ID as their last snapshot (with modifications applied) when editing an offline user.
When trying to modify the contents of the current data (inventory) of an offline Player, it fails to save the modifications due to an SQL constraint violation. When the player is online, the data modifies as intended and is correctly saved to the database.
Attached are an image of the current data snapshots of a player, first taken when modified when the player was online (snapshots 4-5) and when the player was offline (snapshot 1)![image](https://github.com/WiIIiam278/HuskSync/assets/10475082/1169afcc-c4b2-49a9-b9fc-6983fb3dcb56)
The thrown stacktrace:
Output of
/husksync status
Java code that is used for the interaction with HuskSync