RockefellerArchiveCenter / aurora

A Django web application to receive, virus check and validate transfers of digital archival records, and allow archivists to appraise and accession those records.
http://projectelectron.rockarch.org/
MIT License
25 stars 6 forks source link

Transfer table does not sort sizes correctly #646

Open helrond opened 5 months ago

helrond commented 5 months ago

Describe the bug

Transfer sizes are not sorted correctly in the transfers table. They are sorted by number regardless of unit (KB, MB or GB)

To reproduce

Steps to reproduce the behavior:

  1. Sort the transfers table by size in Aurora prod and you'll see something like the following:
Screen Shot of mis-sorted transfer sizes

Expected behavior

Transfers should be sorted correctly by size regardless of units used.

Impact on your work

Not a huge deal but would be good to get sorted out.

helrond commented 5 months ago

From initial research it appears that this is happening because the number in the machine_file_size field exceeds the Javascript MAX_SAFE_INTEGER. Datatables suggests using orthogonal data however this approach is throwing an error in the filter_queryset method of the DatatableMixin. This could likely be solved by updating the library which supports the server-side rendering for Datatables (see, for example, the django_datatable_serverside_mixin.