biigle / maia

:m: BIIGLE module for the Machine Learning Assisted Image Annotation method
GNU General Public License v3.0
2 stars 3 forks source link

Bulk select proposals/candidates exceeds API rate limit #170

Open mzur opened 5 months ago

mzur commented 5 months ago

If a user uses the Shift+Click feature to bulk-select proposals/candidates, they can easily exceed the API rate limit because each proposal/candidate is updated with a separate request.

To fix this, update the proposal/candidate API endpoints to accept a list of up to 100 updated proposals/candidates (similar to the annotation bulk API endpoint). In the frontend, the single change then sends a request with a single list item. A bulk-select action, however, now sends bulk requests, too (splitting the actual number of changed proposals/candidates into chunks of 100).

mzur commented 3 months ago

Training proposals are updated (one at a time) here, annotation candidates here. The respective API endpoints are here and here. The tests can be found here and here.

For local development without a configured GPU for MAIA jobs, a fake MAIA job can be created manually as follows:

The training proposals and annotation candidates won't have actual thumbnails with the faked data but they can be (bulk) selected, which is enough for this issue.