Skip to content

fix(api): accept is_server in S3Storage so v1 asset endpoints stop 500ing - #4

Merged
thestumonkey merged 1 commit into
planeforkfrom
fix/s3storage-is-server
Sep 13, 2026
Merged

thestumonkey merged 1 commit into
planeforkfrom
fix/s3storage-is-server

Conversation

@thestumonkey

Copy link
Copy Markdown
Member

plane/api/views/asset.py constructs S3Storage(request=request, is_server=True) in three places, but S3Storage.__init__ only accepts request. Every call raises TypeError, so all three public-API asset endpoints answer 500:

  • GET /api/v1/workspaces/{slug}/assets/{asset_id}/ — presigned download
  • the two generic-asset upload paths

Reproduced live:

GET /api/v1/workspaces/psyclopedia/assets/030f4338-…/  →  500 {"error":"Internal server error"}

The GET is the only x-api-key route that turns a comment image's asset id (the src on <image-component>) into a download URL. Found because psyclo relays a developer's comment images to a bug reporter by email, and every fetch failed silently.

Fix

Accept is_server=False on S3Storage.__init__. It has no effect yet: its callers hand the presigned URL to a client outside Plane's network, so the public endpoint — the existing default — is already what they need.

One file, no behaviour change for any existing caller.

🤖 Generated with Claude Code

https://claude.ai/code/session_01SsBurBNYE4Wxpx2k6atqcj

…0ing

plane/api/views/asset.py constructs `S3Storage(request=request, is_server=True)`
in three places, but `S3Storage.__init__` only takes `request`. Every call
raised TypeError, so all three public-API asset endpoints answered 500 --
including GET /api/v1/workspaces/{slug}/assets/{asset_id}/, the only
x-api-key route that turns a comment image's asset id into a download URL.

Found because psyclo relays a developer's comment images to a bug reporter by
email: the fetch failed on every image, silently.

The argument is accepted and has no effect yet. Its callers hand the presigned
URL to a client outside Plane's network, so the public endpoint -- the existing
default -- is already what they need.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SsBurBNYE4Wxpx2k6atqcj
@thestumonkey
thestumonkey merged commit d5df11d into planefork Sep 13, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant