Page MenuHomePhabricator

Consider returning a result even if the fallback template does not apply
Open, MediumPublic

Description

There may be cases where the fallback template does not apply. See T305168 for a possible workaround.

In these cases, the Web2Cit-Server would return an empty results array.

On the one hand, this would neglect the translation tests that may have been defined, making the Web2Cit-Monitor believe that no test has been defined for a specific target path.

On the other hand, because a result table would not be included in the html-format response, and because the "edit" link to edit the translation templates configuration file is included in the header of this table, this would leave users with no easy way to edit this configuration (in cases where doing so may be useful).

Consider returning an empty-outputs result in cases where no template applies for a given target.

Event Timeline

In addition, right now a path for which no applicable translation template is found, makes the Web2Cit-Monitor fail for the whole domain (T321093).

diegodlh triaged this task as Medium priority.Oct 18 2022, 11:59 AM
This comment was removed by diegodlh.

On the other hand, because a result table would not be included in the html-format response, and because the "edit" link to edit the translation templates configuration file is included in the header of this table, this would leave users with no easy way to edit this configuration (in cases where doing so may be useful).

Also, debugging information does not seem to be showing in these cases. See for example: https://web2cit.toolforge.org/https://cidades.ibge.gov.br/brasil/pr/sao-joao-do-triunfo/pesquisa/38/46996

A user may want to fix a non-applicable fallback template by defining a custom template and they may have trouble debugging it because of this.

Because the debugging information is not part of the main block to which the result table belongs to, this probably should be addressed on a separate task.

There may be cases where the fallback template does not apply.

One possibility may be that Citoid returns a Web2Cit-invalid output for a given translation field. See T313236.

However, a far more common example may be a webpage returning a 404 error (pages no longer available, or invalid paths). This would return a 404 response from Citoid as well, which would cause the fallback template to be non-applicable.

Consider returning an empty-outputs result in cases where no template applies for a given target.

Make sure Web2Cit response continues to be 404 in these cases. See T305166.

Solving this issue, preferably before the Web2Cit session planned for the Wikimedia-Hackathon-2023, would greatly increase the usability of the monitor list during that session. Note that the monitor should be asked to re-run checks on all domains for changes to reflect immediately on the list.

no easy way to edit this configuration (in cases where doing so may be useful).

One of the cases why the fallback template does not apply may be because Citoid is returning a general error (see for example https://teara.govt.nz/en/biographies/4g2/galbraith-alexander). However, in these cases, there seems to be a bug causing the server to crash if a translation template has been configured; see T347508.

Because addressing the present task would provide users with an easy way to edit and create translation templates, it would important to address T347508 before to prevent server crashes.