Most likely the "secret database" is just the filesystem. Keeping things forever is the default behavior of filesystems.
A photo library application is just a database pointing to files in the file system. In some cases photos were deleted from the library database without being deleted from the filesystem. That's the bug.
The consequences are that: 1) the photo appears to be deleted to the user, who goes by what the application tells them 2) the photo appears to be deleted to the application, who goes by what the database says, and 3) the photo miraculously reappears when the filesystem is re-indexed by the application.
A photo library application is just a database pointing to files in the file system. In some cases photos were deleted from the library database without being deleted from the filesystem. That's the bug.
The consequences are that: 1) the photo appears to be deleted to the user, who goes by what the application tells them 2) the photo appears to be deleted to the application, who goes by what the database says, and 3) the photo miraculously reappears when the filesystem is re-indexed by the application.