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.
Steps to reproduce
- 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
- Create or open a channel
- Send a plain text message
- 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
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 withoutIMAGE_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.
Steps to reproduce
IMAGE_PROXY_URLunsetIMAGE_PROXY_SECRETunsetR2_S3_APIunsetR2_ACCESS_KEY_IDunsetR2_SECRET_ACCESS_KEYunset400 Bad RequestSuspected cause
_enrich_messages_with_file_urls_legacy()initializes the R2 client before checking whether the message actually contains anyfileblocks. For text-only messages, that eagerly creates a boto3 client with an empty endpoint, which raisesInvalid endpoint:.Environment
core-oss