kimai / Paid-plugins

Support for paid Kimai plugins: Discussions and feature requests
https://www.kimai.org/store/
11 stars 1 forks source link

Audit logs: Changes to "exported" state are not shown in timesheet specific change history, when using the "mark as exported" switch during exports #86

Open de-sec opened 1 year ago

de-sec commented 1 year ago

Describe the issue

Good Morning everyone,

i'd like to report a bug within the audit trail extention:

  1. if exports of timesheets are performed while using the option "mark as exported", the audit-log plugin doesn't show changes to the exported state within the timesheet specific change history (it's shown in the global change history only)

is there any possibility to add this aspect?

Best regards

I already tried

Kimai version

2.0.28

How do you run Kimai?

Virtual Server or alike

Which PHP version are you using?

8.1

Logfile

No response

kevinpapst commented 1 year ago

There are technical limitations:

Certain batch updates (e.g. setting the exported flag of multiple timesheets during export) cannot be recorded, as those are executed directly via database.

There is logic that was added to prevent DDOS entries on database level: Let's assume you export 1000 entries, then the database would receive 1000 updates and 1000 inserts for Audit history. That is a problem and slow. Instead Kimai just executes one huge update for all exported items and that cannot be read by Audit.

This is not directly a bug, even though it might seem like one. The plugin can only register updates that are made through the internal API, not when something happens directly on database level.

I do see that this is an issue, especially for the exported flag, I am just not sure how to work around that problem.