Aircloak / aircloak

This repository contains the Aircloak Air frontend as well as the code for our Cloak query and anonymization platform
2 stars 0 forks source link

Audit log date picker not working on empty audit log result set? #4888

Closed sebastian closed 3 years ago

sebastian commented 3 years ago

When I set the audit log from and to fields to be very expansive: say from 1st of Jan 2000 to January 2020, then the result is empty, and then the date popups no longer works.

Example: https://demo.aircloak.com/admin/audit_log?from=2000-01-01+13%3A30%3A09&to=2020-12-01+13%3A30%3A09

edongashi commented 3 years ago

The volume of data is so massive that even a 60 second timeout is not enough for it to complete. nginx times out the request. I suggest we limit the number of audit log entries to a big number starting from the latest queried date.

edongashi commented 3 years ago

I see results are already paged, but the whole dataset needs to be sorted and processed first before cutting slices. Who knows how many millions of rows there are... maybe allow only a month slice at max?

sebastian commented 3 years ago

Hm, can we catch the exception and say the dataset is too large to be computed, and recommend they slice the data better?

edongashi commented 3 years ago

Hm, can we catch the exception and say the dataset is too large to be computed, and recommend they slice the data better?

Good idea. I'll see if this can be caught.

edongashi commented 3 years ago

Deployed the PR branch to demo and seems to work: https://demo.aircloak.com/admin/audit_log?from=2000-01-01+13%3A30%3A09&to=2020-12-01+13%3A30%3A09

Takes a while to load, but on timeout shows the proper error.

edongashi commented 3 years ago

But it keeps trying to fetch the data again... what's up with that?

Edit: Seems to happen when you load via direct URL. By regular navigation it works fine.

edongashi commented 3 years ago

Live view does a hard reset when the page fails to load in time. The timeout can probably be adjusted, or we can lower the timeout for the audit log query. 15s is the default.

sebastian commented 3 years ago

Takes a while to load, but on timeout shows the proper error.

Much better with this error!

edongashi commented 3 years ago

Ok, made the UX much smoother by preventing the double load - liveview renders once for static HTML and on second render hydrates the view, causing 2 massive queries to run back to back.

https://demo.aircloak.com/admin/audit_log?from=2000-01-01+13%3A30%3A09&to=2020-12-01+13%3A30%3A09

edongashi commented 3 years ago

And here's an example of a slow but successful load: https://demo.aircloak.com/admin/audit_log?from=2020-05-18+09%3A59%3A33&to=2021-06-18+09%3A59%3A33.946202Z