File entities don't handle local_state correctly for setting datafilehandleid

Description

If you do:

1 2 3 4 5 f = syn.get(...) fh = #Some other filehandle f.dataFilehandleId = fh['id'] f = syn.store(f)

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.

Environment

None

Status

Assignee

Ziming Dong

Reporter

Larsson Omberg

Labels

None

Validator

Thomas Yu

Release Version History

None

Fix versions

Priority

Major