Fossil Forum

Backlinks for tickets are not created if column "mimetype" is GENERATED

Backlinks for tickets are not created if column "mimetype" is GENERATED

(1) By george on 2021-10-21 21:37:34 [source]

Backlinks are created by the backlink_extract() function which (among other arguments) takes a mimetype. When a ticketchange artifact is processed this mimetype is derived SOLELY from this artifact. Fossil does not take into account neither GENERATED nor DEFAULT values configured by the ticketing table schema (note PRAGMA table_info() instead of PRAGMA table_xinfo()).

This becomes a problem if ticketing is setup to use Markdown exclusively (for example, to reduce users' confusion) and omit (then redundant) "J mimetype text/x-markdown" lines from the artifacts (which reduces the clutter in the /tkthistory).

In that case ticket_insert() implies Wiki formating for the backlink_extract() calls.

Two things here seem especially annoying to me:

  1. This behaviour is rather unexpected and undocumented.

  2. If the absence of backlinks is noticed after some time of active ticketing then it is hard to "repair" the repository.

I suggest that Fossil should either

  • respect the mimetypes from the ticketing schema

  • or allow default mimetype value(s) be configured as a setting

The former seems more appealing, but also harder to implement.

What do think? Is this issue worth fixing, and if so then how?

(2.1) By george on 2022-05-18 22:22:19 edited from 2.0 in reply to 1 [link] [source]

The problem is tackled in generated-ticketchng.mimetype branch generated-tkt-mimetype branch, where TICKETCHNG "mimetype" columns is are honored even if that column is GENERATED.

Please say if you see issues in the proposed solution.

UPDATE: change name of the branch and amend the wording.

(3) By george on 2022-05-19 18:47:01 in reply to 1 [link] [source]

I would like to merge generated-tkt-mimetype branch into trunk.
Please let us know if there are any objections.

(4) By Stephan Beal (stephan) on 2022-05-19 18:56:51 in reply to 3 [link] [source]

Please let us know if there are any objections.

My only objection is that i'll have to port that over to libfossil ;).

None from me. i believe Richard is unavailable the rest of today and possibly tomorrow, so it might be the weekend or next week before he can voice his thoughts.

(5) By george on 2022-05-19 19:27:55 in reply to 4 [link] [source]

port that over to libfossil ;)

It seems that for the time being libfossil does not extract backlinks from the ticket change artifacts (or perhaps at all). That requires a port of wiki and markdown processors (at least truncated versions of these). Seems like a very low priority target.

... Richard is unavailable ... [until] ... weekend or next week ...

I'll wait.