ListDirectory returns deleted files

I made an app that uploads images from the Shared storage scope to Google Photos. This works. I added a mode that deletes uploaded images. This also works, the images are no longer visible in either the Gallery or in the Files app. However, running ListDirectory still includes deleted entries. I tested this in the companion and in a built APK that was installed for the first time after the files were deleted, so if there's some kind of cache it's not specific to one app. I am running Android 8.1. The app requires logging in to an OAuth page that's not open to others so sharing the aia would not be useful. The code is just a ListDirectory block like this:

I can reproduce even just using the Do It menu with that block.

Before and after removing all files from the folder:


Try using the Shared scope and the Delete block, not an external app.

There is a bug with Shared scope:

and on Android < 10 doesn't work (Companion crashes).

@ewpatton you might want to add this to the file component bug list
Thank you


1 Like