Skip to content

Add the duration field to the file upload responses - #58

Merged
gpunto merged 1 commit into
mainfrom
upload-response-duration
Aug 14, 2026
Merged

Add the duration field to the file upload responses#58
gpunto merged 1 commit into
mainfrom
upload-response-duration

Conversation

@gpunto

@gpunto gpunto commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

🔗 Issue Links

Surfaced by GetStream/stream-chat-android#6632, which switches Android's uploads to the OpenAPI-generated model.

  • The four file/image upload routes returned only file. In the backend OpenAPI specs, duration is the only required property of FileUploadResponse/ImageUploadResponsefile and thumb_url are optional — so every client generated from them has duration mandatory and fails to decode the mock response (on Android: Required value 'duration' missing at $).
  • Added a shared upload_response helper and used it in all four routes. thumb_url stays omitted, as the real backend omits it when no thumbnail was generated.
  • Those routes built their body with .to_s (Ruby hash-inspect, not JSON) and now use .to_json. The ~16 other .to_s bodies in endpoints.rb are a follow-up.
  • Verified by POSTing all four routes against a local server: valid JSON with file and duration.

🧪 Testing Notes

Please verify the E2E test runs:

  • iOS
  • Android
  • Flutter
    • run 31574865177 — fails, but not because of this branch: last night's nightly on mock main fails identically (message_list_test/reactions_test, same counts, same RawTooltipState is a SingleTickerProviderStateMixin but multiple tickers were created assertion). No attachment test involved and no upload decode error in the logs.

@gpunto
gpunto force-pushed the upload-response-duration branch from 1cf3664 to fdf8390 Compare August 12, 2026 07:43
@gpunto
gpunto force-pushed the upload-response-duration branch from fdf8390 to 1696fd3 Compare August 12, 2026 07:57
@gpunto
gpunto marked this pull request as ready for review August 12, 2026 10:24
@gpunto
gpunto requested a review from testableapple August 12, 2026 10:24

@testableapple testableapple left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@gpunto
gpunto merged commit 0f47b31 into main Aug 14, 2026
4 checks passed
@gpunto
gpunto deleted the upload-response-duration branch August 14, 2026 09:13
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.

2 participants