Simplix-Softworks / SimplixStorage

Library to store data in a better way
Apache License 2.0
138 stars 25 forks source link

Certain JSON file(s) still not reloading/updating automatically #28

Closed test414EFF closed 4 years ago

test414EFF commented 4 years ago

Describe the bug My shops file doesn't seem to be updated automatically even when my accounts file is. Everything works as intended after I either restart the server or do /reload.

To Reproduce My shop storage class: https://gist.github.com/test414EFF/6656433ce12c8f6e9912c4060393f52a

Expected behavior Both JSON files should be updated without having to reload the server.

Additional context JSON file: https://gist.github.com/test414EFF/ffa5a20d23b632db19ce3eaa799281f3

test414EFF commented 4 years ago

I tried printing FLATFILE.getFileData().toMap().toString() to console after creating a new shop - this just resulted in the file being printed out without the new shop. Upon reload, the correct file was printed.

KotlinFactory commented 4 years ago

Hi 414Eff,

thank you for reporting this!

Can you tell me which line exactly is not working, please?

Direct fix: (Until the next release) Just use forceReload()

Regards,

test414EFF commented 4 years ago

Specifically, it's this line: [24] return Bukkit.getOfflinePlayer(UUID.fromString(shops.getString(name + ".info.owner"))).getName();

KotlinFactory commented 4 years ago

I will have a look soon

KotlinFactory commented 4 years ago

I have done extensive testing & cant reproduce the issue.

KotlinFactory commented 4 years ago

Anything new?

test414EFF commented 4 years ago

Oh, sorry - I could have sworn that I saw a comment saying you had found the issue earlier... I'm not too sure - the plugin that I was having this issue with is currently being rewritten. I can't see why one json file would work and the other wouldn't, so perhaps it was my own error (though I did print the file to console as you suggested and it showed the outdated file before reloading).

I think it would be safe to close the issue, and I can either reopen this issue, or open a new issue, if the problem occurs again.