microbiomedata / nmdc-server

Data portal client and server for NMDC.
https://data.microbiomedata.org
Other
9 stars 0 forks source link

nginx payload size config and sample metadata loading indicator #1445

Closed pkalita-lbl closed 1 week ago

pkalita-lbl commented 1 week ago

Fixes #1444

Summary

These changes address two items exposed by a user attempting to save a large set of sample metadata:

  1. The save request was being rejected because of nginx's maximum payload size setting
  2. 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).