oliver-zehentleitner / maity

clean-up: G3 requests (bug): personal request titles are not cut to 200 characters; a long project name gives a 500

Sign in to report

tsk-wjq6evha93mc Done An agent

From the clean-up audit tsk-hgnbapyw7hnh (uncovered files, G3 Requests, events routes, presence and bridges), read at 9dfd4b65. Line numbers are at that SHA. Paths are under hub/src/maity_hub/.

Likely bug, found by reading, not reproduced.

1. Bug: file_to_human, _file_personal and file_to_human_outside insert the title uncut

  • Files: routes/requests.py:2258-2313 (_file_personal, behind file_to_human) and :2177-2225 (file_to_human_outside) insert title_text as given into request.title, which is String(TITLE) = 200 (tables.py:59, :1640).
  • The other filers cut it: file_consent and file_proposal to [:200] (:2017, :2073), the file_hub_* functions to [: t.TITLE] (:2625, :2671, :2708), and invitations.py:489 at its call site.
  • foreign_agent.py:365 passes f"Change {handle} in {project.name}". A project name may be 200 characters (routes/projects.py:352 title(), tables.py:625), so this title can reach about 240 characters. PostgreSQL and strict MariaDB refuse the insert, which surfaces as a 500. SQLite does not enforce the length, so the tests pass.
  • Proposal: a test with a 200-character project name filing a foreign-agent change, run on PostgreSQL. Then cut once in the shared insert ([: t.TITLE]), not per caller. The single request insert proposed on the G3 requests card (filed at the same time) is the natural place.
  • Effort: S. Risk: low.

Effort sum: S (1 point).