Skip to content

perf(mobile): stop downloading whole videos for posterless stills - #9367

Merged
brow merged 2 commits into
mainfrom
fix-9356-poster-downloads
Nov 12, 2026
Merged

brow merged 2 commits into
mainfrom
fix-9356-poster-downloads

Conversation

@brow

@brow brow commented Nov 11, 2026 •

Copy link
Copy Markdown
Collaborator

Follow-up to #9356 gallery video selection, merged as ef57fec4d. It makes two changes that came out of review.

1. Remove automatic stills for videos without poster metadata

#9356 generated a still for every rendered video bubble or stack card that had no NIP-71 poster. To do that it downloaded the whole video (up to the 100 MB limit), grabbed a frame and threw the file away. Desktop (buzz-app) never writes image/thumb on video attachments, so this covered every desktop-sent video, not only old mobile messages. Before #9356 those bubbles were a static placeholder that used no network.

The cost on a real timeline:

  • A four-card stack could pull up to about 400 MB just for stills, before anyone pressed play.
  • When the user did open a video, playback started its own separate download of the same file, and the poster download kept competing for bandwidth.
  • A failed, cancelled or stalled download saved nothing, so every remount (scroll back, swipe back in a stack) started the full GET again. Cached stills from non-relay URLs were also dropped and fetched again after the cache's seven-day expiry.

This PR deletes that path: video_poster.dart and its test, plus the watchers and generatedPoster branches in video_preview.dart and media_stack.dart. Posterless videos are back to base behavior: "Video attachment" in a bubble, the plain surface on a stack card, and the source snapshot in the native viewer. The rest of #9356 stays: queued local stills (prepareVideoPoster on the local file, no network), the remote-poster preview in the native viewer, the picker changes and swipe dismissal.

NativeVideoFiles._cancelTimeouts was added for poster disposal. No remaining test depends on it, so it goes back to base too.

If stills for desktop-sent videos are still wanted, a bounded follow-up is to generate and cache the still from the file that playback already downloaded, after the user opens it. That adds no network.

2. Route .3gpp and .3g2 picks as videos

The Video row is gone from the attachment menu, so _isPickedVideo is now the only thing that classifies path-only picker results. Its extension list missed 3gpp and 3g2. The recent-media grid returns the original library file, and PHPicker exports 3GPP2 as .3g2, so those videos were queued as images and then rejected by uploadImage. Before #9356, the explicit Video action uploaded them through uploadVideo, which transcodes to MP4.

Pareto

The change only removes work: no extra network or decoding for posterless videos, and no change for videos that carry a poster. The one thing we give up is the still on posterless videos that #9356 added and base never had.

Validation

  • Added test rows: clip.3gpp and clip.3g2 in the existing mixed-gallery composer journey. Both now queue as video.
  • Full mobile flutter test passes on 518af3a0d: 4,688 passed, 71 skipped. flutter analyze is clean.
  • I didn't run an app journey for this fix. It brings the posterless paths back to base code, and Fix gallery video selection, thumbnails, and swipe dismissal #9356's own validation covers the rest.

Review report: buzz://message?channel=e71f9a2a-ac46-473d-a24e-5e16fd8cb7b1&id=bcae52d59c255add1a927e0135441a1c58115b6aa6cda8d9ff7e58d47a627a87

🤖 Generated with Claude Code

@brow

brow commented Nov 11, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-12T02:58:34.778301Z b473417 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: 612b6fe3c5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Base automatically changed from kennylopez-gallery-media-fixes-20261111 to main November 11, 2026 21:22
Delete eager poster generation for videos without NIP-71 poster
metadata. Each rendered bubble or stack card downloaded the whole
video (up to 100 MB) to grab a frame, and desktop never writes
posters, so this covered every desktop-sent video. Posterless videos
go back to the static placeholder.

Also route .3gpp and .3g2 picker results as videos now that the
explicit Video attachment action is gone.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Tom Brow <[email protected]>
@brow
brow force-pushed the fix-9356-poster-downloads branch from 612b6fe to 518af3a Compare November 11, 2026 21:25
@brow
brow marked this pull request as ready for review November 12, 2026 02:57
@brow
brow requested a review from a team as a code owner November 12, 2026 02:57
@brow
brow enabled auto-merge (squash) November 12, 2026 02:57
@brow
brow deployed to codex-review November 12, 2026 02:57 — with GitHub Actions Active
@github-actions github-actions Bot added the codex-security-review-current The posted Codex security review matches its recorded range. label Nov 12, 2026
@github-actions

Copy link
Copy Markdown

🔐 Codex Security Review

Note: This is an automated, security-focused review generated by Codex.
Use it as a supplement to human review; false positives are possible.

Scope

  • Exact PR diff: 4c60be6a1e8dc2c7839f7c0294391fb93941ed9f...b473417551c248f096a8375a2e9bfdb1caed733a
  • Model: gpt-6.1-sol

💡 Click "edited" above to see earlier reviews for this PR.


Review Summary

Overall Risk: NONE

No concrete security, correctness, or reliability findings in the authorized PR range. Traced video previews, playback, authentication, download limits, cancellation, cleanup, and attachment uploads.

Findings

No concrete security, correctness, or reliability findings were identified.

Notes

  • Review used read-only source, history, and test inspection. Builds and tests were not executed, as requested.

Generated by Codex Security Review |
Requested by: @brow |
Workflow run

@brow
brow merged commit 85c7156 into main Nov 12, 2026
59 checks passed
@brow
brow deleted the fix-9356-poster-downloads branch November 12, 2026 03:18
ravarora2 pushed a commit that referenced this pull request Nov 12, 2026
…small

* origin/main:
  fix(db): seek replaceable heads by channel (#9147)
  buzz-db: check events created_at floor in app writers (phase 1) (#8325)
  fix(mobile): keep a thread tail behind the keyboard unread (#9295)
  fix(mobile): restore header cues and per-channel identity check for #9369 (#9370)
  fix(relay): treat empty filter sets as match-nothing in SQL (#9342)
  buzz-cli: add --before and --before-id to messages search (#9382)
  feat(relay): agents cannot write in DMs except with their owner (#9371)
  fix(relay): bound each cross-node delivery attempt (#9305)
  feat(mobile): add iOS Home Screen shortcuts for New chat, New DM and the Bestie (#9360)
  perf(mobile): stop downloading whole videos for posterless stills (#9367)
  Enforce single-community relay mode (#9149)
  fix(relay): match #a tag filters in SQL before LIMIT (#9339)
  Add participant avatars to mobile conversation headers (#9369)
  fix(mobile): stop asking for an API token when the channel list is refused (#9327)
  chore(release): release Buzz Relay version 0.3.0 (#9362)
  Fix gallery video selection, thumbnails, and swipe dismissal (#9356)

Signed-off-by: dessert <7d616e7e143e5d408159614dccff1371350a1c1bd36c8de838a45ece5aca0aca@buzz.block.builderlab.xyz>

This branch was successfully deployed

1 active deployment
codex-review — b4734175 Deployed Nov 12, 2026 by brow via Run Codex Security Review #14549
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

codex-security-review-current The posted Codex security review matches its recorded range.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants