If you do:
The file handle that is associated with the file is updated but the local_state metadata associated with f is still referencing the old file medata. The reason is that the store function only updates these fields if the file is being uploaded. Additionally it is not possible to populate these fields always as the fileEntity f doesn't have access to the filehandle only its id.
We might want to rethink what data we actually have saved locally for a file. For example a lot of code could be simplified if we always had the filehandle present on each entity.