"Delete Game Data" button does not delete game's data

I'm currently developing a game and recently came across an issue when trying to reset the game's data on hardware where the data is not cleared. I am developing with SDK version 3.1.2 on Windows with Lua and saving game data with playdate.datastore.write() to a file named playerdata.json. I am trying to delete the game's data through the system settings (System -> Game Library -> Sideloaded -> MyGame -> Delete Game Data) and when I press the button, the game data size is marked as 0B, but reopening the game shows that the data still exists.

I have tried using a data file with the default name of 'data.json' but that didn't make a difference. I am not using the playdate.datastore.delete() method anywhere in my code but I'm wondering if I need to implement it somewhere. I wasn't able to find any information on how the 'Delete Game Data' button works when searching through Google and the dev forum so I'm not sure what I might be missing. The obvious alternative would be to implement a 'delete data' button myself within the game but for simplicity I'd like to get it to work in the other way if possible.

If anyone has experience getting this feature to work I'd really appreciate some insight, thanks!

The "Delete Game Data" button in the system's game menu is certainly working for me. I'm 99% sure it just deletes everything in the games data folder. Is it perhaps your defaults for the datastore being re-created when you boot the game?

I found the problem! It turned out I didn't have a bundleID set in my pdxinfo file. It seems that if a bundleID is not present, the system saves data to Data/(.pdx name)/data.json, but doesn't recognize this folder when trying to delete data. I didn't realize how important the bundleID was for datastore operations.