Attachment listing is completely unpaginated #100

Closed
opened 2026-09-01 00:13:39 -04:00 by jared · 1 comment
Owner

Severity: Low

AttachmentModel::getAttachments() has no LIMIT/OFFSET (unlike, e.g., the comment-pagination pattern already used elsewhere in the app), and api/upload_attachment.php's GET handler passes nothing through. renderAttachments() in assets/js/ticket.js then builds one HTML string containing every attachment for the ticket.

Impact: A ticket with hundreds of attachments loads them all in one API response and renders them all into one DOM grid — loading="lazy" softens the image-decode cost, but the JSON payload size, DOM node count, and delete/download button wiring all scale unbounded with attachment count.

Fix: Add pagination (limit/offset) to AttachmentModel::getAttachments() and the corresponding API/frontend, matching the pattern already used for comment pagination.

**Severity:** Low `AttachmentModel::getAttachments()` has no `LIMIT`/`OFFSET` (unlike, e.g., the comment-pagination pattern already used elsewhere in the app), and `api/upload_attachment.php`'s GET handler passes nothing through. `renderAttachments()` in `assets/js/ticket.js` then builds one HTML string containing every attachment for the ticket. **Impact:** A ticket with hundreds of attachments loads them all in one API response and renders them all into one DOM grid — `loading="lazy"` softens the image-decode cost, but the JSON payload size, DOM node count, and delete/download button wiring all scale unbounded with attachment count. **Fix:** Add pagination (limit/offset) to `AttachmentModel::getAttachments()` and the corresponding API/frontend, matching the pattern already used for comment pagination.
jared added the performancepriority/low labels 2026-09-08 10:15:50 -04:00
Author
Owner

Fixed and verified (real MariaDB/jsdom/curl-range as applicable). Merged to main in commit 23d94bf.

Fixed and verified (real MariaDB/jsdom/curl-range as applicable). Merged to main in commit 23d94bf.
jared closed this issue 2026-09-08 21:18:23 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: LotusGuild/tinker_tickets#100