From 35f52b0356d141c091ec5c739c0425d081b83930 Mon Sep 17 00:00:00 2001 From: Myx Date: Fri, 5 Jun 2026 08:02:29 +0200 Subject: [PATCH] fix: attachments broken --- agents-docs/LESSONS.md | 7 +++ .../attachment-persistence.service.ts | 43 ++++++++----------- .../services/attachment-transfer.service.ts | 28 +++++------- .../attachment-display-url.rules.spec.ts | 20 +++++++++ .../logic/attachment-display-url.rules.ts | 11 +++++ 5 files changed, 67 insertions(+), 42 deletions(-) create mode 100644 toju-app/src/app/domains/attachment/domain/logic/attachment-display-url.rules.spec.ts create mode 100644 toju-app/src/app/domains/attachment/domain/logic/attachment-display-url.rules.ts diff --git a/agents-docs/LESSONS.md b/agents-docs/LESSONS.md index ca2f51e..506e8c5 100644 --- a/agents-docs/LESSONS.md +++ b/agents-docs/LESSONS.md @@ -102,6 +102,13 @@ Durable rules for AI agents working on this project. Read this file at session s - **Why:** `npm run test` only runs the toju-app Vitest suite — it doesn't cover the server, Electron, or website packages. ESLint (flat config in `eslint.config.js`) is the universal check across every package; type-style violations slip through tests and break Gitea Workflows for the next agent. - **Example:** `npm run lint && echo OK` — only claim done after seeing `OK`. For Electron type errors specifically, also confirm `npm run build:electron` succeeds (it invokes `tsc -p tsconfig.electron.json`). +### Use blob URLs for inline attachment previews [attachments] [electron] + +- **Trigger:** receiving users see broken image icons or video players that never start, but "Download" saves a valid file. +- **Rule:** never bind `attachment.objectUrl` to `file://` URLs for chat ``, `