freescout-help-desk / freescout

FreeScout — Free self-hosted help desk & shared mailbox (Zendesk / Help Scout alternative)
https://freescout.net
GNU Affero General Public License v3.0
2.75k stars 468 forks source link

Reporting Module Conversations Report: Graph shows all conversations on last day of selected period #4043

Closed HPdeVries closed 1 month ago

HPdeVries commented 1 month ago

PHP version: 8.1.7-1ubuntu3.5 FreeScout version: 1.8.140 Database: MySQL Mysql (8.0.33-0ubuntu0.22.10.2) Are you using CloudFlare: No Are you using non-official modules: No

In the conversation report, metrics in the header appear to be correct (Totals for the period etc), however the graph shows all conversations on the last day of the period. (maybe a date-formatting issue in the data sent to highcharts?)

image

Productivity report does not show this behaviour and appears correct.

freescout-helpdesk commented 1 month ago

Can you provide a screenshot of some conversation from that period?

HPdeVries commented 1 month ago

These conversations are (new) from may tenth:

image image
freescout-helpdesk commented 1 month ago

The only way to figure it out is for someone to check on your server.

HPdeVries commented 1 month ago

today the graph showed up as this:

image

The new conversation from today is reported correctly.

As I installed the reporting module yesterday, together with an upgrade of free scout, I believe that might be the cause. (Does the reporting module use other DB columns than freescout uses for date/timestaming? I have not yet looked at the code.)

As this issue seems to no longer appears for new conversations, I think this case can be closed.

HPdeVries commented 1 month ago

Have been looking into this a bit; for the new conversations the DB query seems to look at the updated_at column, where I would expect a created_at column:

image

I changed this to created_at as test, now the graph appears correct:

image image

I also changed this for the Messages Received query, which also fixed the issue.

For now, I am assuming the modified column got overwritten by the most recent upgrade of freescout, as these messages have not been edited since creation. create date should be modified date, but apparently are not.

Machtendrg commented 1 month ago

I to am having the same issue,

where can I go to fix this please ?

HPdeVries commented 1 month ago

I changed the chartNewConvData and chartMessagesData functions in ReportsControllers.php file in ./Modules/Reports/Http/Controllers to use the created_at columns in stead of updated_at.

Please beware, this is a temporary fix as I am sure this will be overwritten in the next automatic update.

I believe something went wrong in the last upgrade to the latest FreeScout release which caused all the updated_at columns to be overwritten with the current date. That is probably the reason the report stopped working. I have not looked at the database yet, as I don't have phpMyAdmin or a similar tool installed at our server.

I have tried to re-open this issue to let this know to the maintainer but have not found a way yet.

HPdeVries commented 1 month ago

I just did a quick check from the console:

image

2024-05-28 10:10:04 is the moment I did the last upgrade of Freescout. I will submit this as a separate issue for the maintainer to look at.

freescout-helpdesk commented 1 month ago

It has been fixed in Reports Module v1.0.41

HPdeVries commented 1 month ago

Cool, thanks!

Installed the update and I can confirm the issue has been resolved! Great work!