You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Save local key-value store records with the correct extension (#91)
There was a bug that files in local key-value store were saved with the
wrong extension, e.g. `Actor.set_value('image.png', data)` would save
the record as `image.png.bin`.
This fixes it by making the filename generation more sensible:
- the `.bin` extension won't be added anymore if the content type is
`application/octet-stream`.
- the record metadata is no longer saved as
`{record_key}.__metadata__.json`, but as
`{record_filename}.__metadata__.json`
- this makes it a lot easier to find the right metadata for a given file
when opening the store
- the metadata no longer contains the `extension` attribute, just the
key
- the internal record representation now contains the `filename`
attribute pointing to the filename under which the record is saved.
I think the logic is a bit more readable this way, and it works better.
I also wrote a lot of tests to check if it works correctly, they're a
bit hacky, but good enough.
Fixes#85.
0 commit comments