The jsoncs3 sharing implementation relies on proper handling of IfNoneMatch and IfMatch headers.
Unfortunately, there is a codepa that might return a 500 server error when the IfNoneMatch header is set:
the datatx GetOrHeadFile implementation calls fs.GetMD
the etag changed as required bd IfNoneMatch
someone else updates the file
the fs.Downcload file fails because the etag new changed from the previous GetMD call.
This causes the jsoncs3 share manager to error out. The jsoncs3 code just seems to return an error for the request but I fear that corrupts the share cache which would be metadata loss. During load testing this prevented any further shares to be created, because the received.json file for the recipient group had somehow been deleted.
I intend to add a new interface that can be used by GetOrHeadFile to get athe metadata and a callback that will return the corresponding Reader
type ConsistentDownloader interface {
// ConsistentDownload returns the metadata for a resource and a callback to get the content stream matching the etag
ConsistentDownload(ctx context.Context, ref *provider.Reference) (*provider.ResourceInfo, func(ctx context.Context, ref *provider.Reference) (io.ReadCloser, error), error)
}
The jsoncs3 sharing implementation relies on proper handling of IfNoneMatch and IfMatch headers.
Unfortunately, there is a codepa that might return a 500 server error when the IfNoneMatch header is set:
This causes the jsoncs3 share manager to error out. The jsoncs3 code just seems to return an error for the request but I fear that corrupts the share cache which would be metadata loss. During load testing this prevented any further shares to be created, because the received.json file for the recipient group had somehow been deleted.
I intend to add a new interface that can be used by GetOrHeadFile to get athe metadata and a callback that will return the corresponding Reader