Skip to content

Text-only channel messages fail when R2 is not configured #39

Description

@mwzhu

What I expected to happen

Sending or fetching a text-only channel message should work even when Cloudflare R2 and the image proxy are not configured.

What actually happened

In a local/self-hosted setup without R2_S3_API / R2 credentials and without IMAGE_PROXY_URL / IMAGE_PROXY_SECRET, sending a plain text message returned:

  • 400 Bad Request
  • {"detail":"Invalid endpoint: "}

The message row was already inserted successfully, but the response path failed afterward.

Image

Steps to reproduce

  1. Run the app locally with:
    • IMAGE_PROXY_URL unset
    • IMAGE_PROXY_SECRET unset
    • R2_S3_API unset
    • R2_ACCESS_KEY_ID unset
    • R2_SECRET_ACCESS_KEY unset
  2. Create or open a channel
  3. Send a plain text message
  4. Observe the request fail with 400 Bad Request

Suspected cause

_enrich_messages_with_file_urls_legacy() initializes the R2 client before checking whether the message actually contains any file blocks. For text-only messages, that eagerly creates a boto3 client with an empty endpoint, which raises Invalid endpoint: .

Environment

  • OS: macOS
  • Browser: Chrome
  • Local/self-hosted core-oss
  • Backend and frontend running locally

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions