What problem does it solve?
It solves the complexity of handling user-uploaded attachments in a multi-service IM system—ensuring only authorized uploads/downloads and correct metadata propagation through internal gRPC boundaries.
Core Features & Use Cases
- Internal gRPC attachment domain: Provides AttachmentService (not public REST/WS) to gateway via internal calls for upload/download authorization and reference validation.
- Object storage integration: Creates context-aware SeaweedFS/S3 pre-signed requests, validates stored objects, and writes attachment metadata to PostgreSQL.
- Media vs file processing rules: Publishes
aim.attachment.uploaded for media attachments (image/video/audio) while ordinary file attachments are marked parsed immediately and do not go to data parsing.
- Correct eventing and trace propagation: Ensures the uploaded event payload includes
file_id and carries tracing context to support observability and debugging.
Quick Start
Ask the AI: “Summarize the attachment domain boundaries, gRPC contract change rules, and the media-upload event behavior for aim.attachment.uploaded in this repository.”