These changes address two items exposed by a user attempting to save a large set of sample metadata:
The save request was being rejected because of nginx's maximum payload size setting
The UI was not telling the user that the request failed
Details
First, the client_max_body_size directive has been added to the nginx config template. It is populated with the value of the NGINX_CLIENT_MAX_BODY_SIZE environment variable. If this variable is not set manually, it will get set to 10m via web/start.sh. This will allow payload sizes of 10 MB (the default is 1 MB). We can also choose to set the NGINX_CLIENT_MAX_BODY_SIZE in Rancher if we need to adjust the value on the fly for whatever reason.
Second, I updated HarmoinzerView.vue so that all of the incrementalSaveRecord calls are made via useRequest. This means that the loading and error state tracking doesn't need to be done manually, and it can be done uniformly for every call. The previous loading and error state tracking was a bit faulty because await incrementalSaveRecord(...) will raise an exception if the underlying HTTP request fails, meaning the bit where isSaving was set to false was never reached. These changes also make it so that the loading indicator is shown whenever a save is happening (including after importing an XLSX file).
Fixes #1444
Summary
These changes address two items exposed by a user attempting to save a large set of sample metadata:
Details
First, the
client_max_body_size
directive has been added to the nginx config template. It is populated with the value of theNGINX_CLIENT_MAX_BODY_SIZE
environment variable. If this variable is not set manually, it will get set to10m
viaweb/start.sh
. This will allow payload sizes of 10 MB (the default is 1 MB). We can also choose to set theNGINX_CLIENT_MAX_BODY_SIZE
in Rancher if we need to adjust the value on the fly for whatever reason.Second, I updated
HarmoinzerView.vue
so that all of theincrementalSaveRecord
calls are made viauseRequest
. This means that the loading and error state tracking doesn't need to be done manually, and it can be done uniformly for every call. The previous loading and error state tracking was a bit faulty becauseawait incrementalSaveRecord(...)
will raise an exception if the underlying HTTP request fails, meaning the bit whereisSaving
was set tofalse
was never reached. These changes also make it so that the loading indicator is shown whenever a save is happening (including after importing an XLSX file).