Trying to download an omero table with < 10 rows with the "Whole Table" download button (top right) causes an infinite loop and a wrong and always increasing download size (here 3MB for a real total size of ~ 79.59 KB ) to be displayed:
The "Show current page as: CSV | JSON" links seem be work correctly.
To Reproduce
Open any table with less than 10 rows in omero web and click the "Whole Table" download button (top right).
In omero_table.html in the download_csv function in this line the batchSize evaluates to 0 for values of rowCount < 10.
Then, when count is incremented here, since batchSize is 0 the count remains 0 causing the infinite loop.
I think this could be solved by forcing the batchSize to be at least 1 e.g. with:
const batchSize = Math.min(Math.max(parseInt(rowCount/10), 1), MAX_BATCH_ROWS);
If it is OK, I could open a PR with this change.
Bug
Trying to download an omero table with < 10 rows with the "Whole Table" download button (top right) causes an infinite loop and a wrong and always increasing download size (here
3MB
for a real total size of ~79.59 KB
) to be displayed:The "Show current page as: CSV | JSON" links seem be work correctly.
To Reproduce
Open any table with less than 10 rows in omero web and click the "Whole Table" download button (top right).
Quick examples at:
With rows >= 10 everything works:
Cause and fix?
In omero_table.html in the
download_csv
function in this line thebatchSize
evaluates to0
for values ofrowCount
< 10. Then, whencount
is incremented here, sincebatchSize
is0
thecount
remains0
causing the infinite loop.I think this could be solved by forcing the
batchSize
to be at least1
e.g. with:const batchSize = Math.min(Math.max(parseInt(rowCount/10), 1), MAX_BATCH_ROWS);
If it is OK, I could open a PR with this change.