Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[4] Dont show stats exceptions/failures/warnings to users #33149

Merged
merged 1 commit into from
May 9, 2021
Merged

[4] Dont show stats exceptions/failures/warnings to users #33149

merged 1 commit into from
May 9, 2021

Conversation

PhilETaylor
Copy link
Contributor

@PhilETaylor PhilETaylor commented Apr 15, 2021

Pull Request for Closes #32005 #33083 #32129 et al.

Summary of Changes

Sometimes "something" stops a successful submission of anonymised stats to the Joomla stats collection endpoint.

Most of the time there is nothing anyone needs to do.

Joomla Stats collection is a vanity "nice to have" and the Joomla project should not be complaining if users fail to submit their stats

The stats process should die gracefully and quietly - unless in debug mode.

Notices, and Exceptions should not be thrown into the users face if the Joomla Stats collection server endpoint is down, unreliable, unavailable, uncountable.

Testing Instructions

Install Joomla 4

Change the url in the file to be a fake non-routable url

protected $serverUrl = 'https://dev.null/stats/submit';

To reset your stats plugin to "out of the box" run sql after s/jos/prefix:

UPDATE `jos_extensions` SET `params` = '' WHERE `name` = 'plg_system_stats';

Test with "always"

Actual result BEFORE applying this Pull Request

Red exception shown to the screen on failed submission of stats

Expected result AFTER applying this Pull Request

No red exception messages
If debug is on - red exception message
if logging is enabled - entries in the log like:


2021-04-15T20:05:35+00:00	WARNING 172.20.0.1	jerror	Could not connect to statistics server: Failed to connect to 127.0.0.1 port 80: Connection refused
2021-04-15T20:05:48+00:00	WARNING 172.20.0.1	jerror	Could not connect to statistics server: Failed to connect to 127.0.0.1 port 80: Connection refused
2021-04-15T20:06:01+00:00	WARNING 172.20.0.1	jerror	Could not connect to statistics server: Failed to connect to 127.0.0.1 port 80: Connection refused

Documentation Changes Required

none

@PhilETaylor

This comment was marked as abuse.

@ceford
Copy link
Contributor

ceford commented May 8, 2021

With the patch applied, if debug is on there is no red exception message but logging continues. That is not what it says in the instructions and I think it would be best to have the message, even tailored to give a bit more explanation.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/33149.

@PhilETaylor

This comment was marked as abuse.

@ceford
Copy link
Contributor

ceford commented May 8, 2021

I have tested this item ✅ successfully on d7da0f7

I am happy with what this pr does. I was thinking a log may be full of useless lines like this:
2021-05-08T12:41:06+00:00 ERROR 127.0.0.1 - Could not connect to statistics server: Could not resolve host: dev.null
But that is a separate issue. If users are logging they need to set up the logger properly. I never really learned how to do that myself.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/33149.

@alikon
Copy link
Contributor

alikon commented May 9, 2021

the stats need more care fore sure
joomla/statistics-server#60

@alikon
Copy link
Contributor

alikon commented May 9, 2021

I have tested this item ✅ successfully on d7da0f7


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/33149.

@richard67 richard67 added the RTC This Pull Request is Ready To Commit label May 9, 2021
@richard67 richard67 added this to the Joomla 4.0 milestone May 9, 2021
@richard67 richard67 merged commit 77e6eba into joomla:4.0-dev May 9, 2021
@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label May 9, 2021
@richard67
Copy link
Member

Thanks!

@wilsonge
Copy link
Contributor

wilsonge commented May 9, 2021

This is simply a vanity tool of the Joomla project (the stats are meaningless anyway as they only show the first version installed, and not the "current" version at all times, so the stats are always incorrect when aggregated and displayed on joomla.org)

It does give the updated data to the project. And as production we used these extensively when trying to figure out minimum requirements for J4 (we filtered out any data not submitted in the last 3 months unlike the data that shows in the graph on j.org)

Although to be clear it’s correct to not show most the warnings to end users (we should probably log them however)

@brianteeman
Copy link
Contributor

it's still fundamentally flawed as no site that said no 5 years ago has ever submitted data again. Perhaps it should be considered to ask everyone again at each update

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants