oliver-zehentleitner / maity

clean-up: inbox: a project's inbox reads every project's open requests and each personal one again; a hub filter, then the web

Sign in to report

tsk-zvhhdv1z8w3k Open

From the clean-up audit tsk-hgnbapyw7hnh, a cross-area finding (web area 17 plus the hub's requests) that the per-area cards left to one shared card. Read at main 80647565; every line number is at that SHA, so check it against current main first.

Kind: slow path / design. Effort: M (S hub + contract text, S web). Risk: low to medium. It needs a contract change in docs/api.md §7.

Relation to the performance umbrella: tsk-a5pxwgkgr73e (in review, owned by eyq5) covers inbox speed in general. Its roadmap (note nte-1xzgjkgmz37n) item 2 was done as tsk-y8gkq1kvt63c (#1519: a project's inbox reads status=open first). Neither has this item: the personal-request read across every project and the one GET /requests/{id} per personal request. So this card is new, but it belongs under that umbrella. Open question for the lead: file it as a child of tsk-a5pxwgkgr73e, or keep it as a clean-up card linked to it?

What is wrong

  • web/js/inbox.js:613-630 (load, project scope): to show one project's inbox, it reads
  • GET …/requests?status=open for the project (:621), and
  • all of GET /requests (:622), the cross-project inbox (every open request of every membership, cross-owner reports_to requests and every personal request, paged by getAll), and then keeps only personal && status === "open" && project.full_name === ctx.slug.
  • Then it reads each remaining personal request again with GET /requests/{id} (readInFull, :605-611, called at :626), because a list item carries no proposal (§7) and a memory proposal (§19.4) or a chat-access request (§9.6) needs its texts.
  • The cross-project scope (:631-639) does the same readInFull for every open personal request; that part is expected there.
  • So a member of many busy projects pays for all of them on every project inbox load, plus N single reads.
  • Smaller, same file: the @-mention picker at :556 reads GET …/members with getAll each time it opens, though M.membersOnce(ctx, slug) (app.js:1963) exists for this and the inbox already uses it at :687.

Proposal

  1. Contract (docs/api.md §7, the GET /requests row at :11655): a filter for personal requests of one project, for example GET /requests?personal=true&project=<owner>/<slug>. personal limits the list to personal requests; project limits it to requests whose project.full_name matches. Optionally, a way to get the proposal inline for personal requests (for example ?full=true), so readInFull is no longer needed per item. Today the list deliberately shows no proposal, so that part needs a decision.
  2. Hub: implement the filter in routes/requests.py (the cross-project list), with a statement-count test.
  3. Web: inbox.js:622 uses the filter, and :556 uses M.membersOnce.

Open questions

  • The contract change needs approval: who approves it? By the rules on tsk-a5pxwgkgr73e, contract changes go to Oliver through lotse.
  • Inline proposals in the list (step 1, optional): worth it, or keep one read per personal request? There are usually only a few personal requests per project.

Left out as duplicates: none. Searched: inbox.js, readInFull, mentionPicker, and the notes of tsk-a5pxwgkgr73e. tsk-3jt5w07yskb6 #26 asks for M.membersOnce on the Agents pages, not in the inbox.

Effort: M = 3 points.