techmatters / terraso-web-client

A React project that powers the frontend of Terraso platform.
https://app.terraso.org/
GNU Affero General Public License v3.0
11 stars 3 forks source link

Check links automatically for errors #643

Open ssfrancis opened 1 year ago

ssfrancis commented 1 year ago

Description

On both the Terraso WordPress site and in the Terraso app, it would be great to automatically check for bad links which generate a detectable error (e.g. 404). We had a recent example of a bad link in the ILM Practical Guide (WordPress), section 1.4, and we can imagine that with the new ability for users to share files via link (vs. upload) that we may see a similar problem: links may be typo'ed or go bad over time.

Additional context

Shared links could be checked both upon creation/sharing (allowing the user to correct immediately), and then daily and automatically. For now it's probably sufficient for a bad link to be reported to us, and we can reach out directly to the Terraso user. We may want to automate notifications someday...

paulschreiber commented 1 year ago

What classes of errors do we want to check? 404? all 4xx? 4xx and 5xx?

ssfrancis commented 1 year ago

Wouldn't we want to check for any errors we could detect which are indicative of page failure (vs. indicative of a communications error which would be transitory)? In earlier discussion you seemed to know which was which, but I can research if you like.

paulschreiber commented 1 year ago

Communication failure would be things like a timeout or NXDOMAIN. Link checkers can't easily validate those. It makes sense for them to flag 400-series errors. We' also have to decide how many redirects to follow and how to avoid/detect redirect looks. Or rather, find someone who has done this already.

I found Broken Link Checker (npm) and Broken Link Checker (WordPress).