镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Serve video and poster previews for invite links - #9306

Merged
klopez4212 merged 3 commits into
mainfrom
invite-og-integration-20261109
Nov 9, 2026
Merged

klopez4212 merged 3 commits into
mainfrom
invite-og-integration-20261109

Conversation

@klopez4212

@klopez4212 klopez4212 commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Invite links currently return HTML without preview metadata. Add server-rendered og:video and og:image tags for /invite/<code>, and bundle the approved MP4 and wordmark-only poster from #9282 into the relay image. Media URLs use the request’s resolved community host, with only TLS posture from RELAY_URL. Unknown hosts and lookup failures receive no metadata; previews stay generic and never redeem invites.

Validation: production web build, workspace Clippy, 52 router tests (including real HTTP and MP4 range requests), metadata tests, and independent agent review pass. just ci stops at unrelated mobile dependency/format checks. The full relay suite was attempted but stopped during database-dependent tests without local infrastructure. Broad local Rust/desktop hooks were stopped for disk pressure; desktop/mobile hooks also lack dependencies and were skipped to publish this draft. Full-stack and native Messages playback remain unverified. The new preview regressions run in both CI test-runner paths.

Rollout: merge and deploy the resulting relay image with its web bundle, verify the invite HTML and both public media URLs, then share a fresh invite in Messages. Full-stack and human validation remain outstanding.

klopez4212 and others added 2 commits November 9, 2026 14:14
Co-authored-by: Terp <5856f6900e8e0a4e0ea1f4f8d2ee33e4753d2119bc122f94ecafc660b46c0511@buzz.block.builderlab.xyz>
Signed-off-by: kenny lopez <klopez4212@gmail.com>
Co-authored-by: Terp <5856f6900e8e0a4e0ea1f4f8d2ee33e4753d2119bc122f94ecafc660b46c0511@buzz.block.builderlab.xyz>
Signed-off-by: kenny lopez <klopez4212@gmail.com>
@klopez4212
klopez4212 marked this pull request as ready for review November 9, 2026 22:22
@klopez4212
klopez4212 requested a review from a team as a code owner November 9, 2026 22:22
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 9, 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-09T22:52:22.582701Z eac46e2 New commits
ℹ️ 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.

@klopez4212
klopez4212 deployed to codex-review November 9, 2026 22:22 — 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 9, 2026
@github-actions

github-actions Bot commented Nov 9, 2026 •

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: 18f3e35413c6fd9b5ebc9254aca4981c6ca7fd5c...eac46e230ff98c1f11f7e001b7035bc431e8c486
  • 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 were identified in the authorized PR range.

Findings

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

Notes

  • Review used read-only source and history inspection. Builds and tests were not run, as instructed.

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

@TheSentinel454 TheSentinel454 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🤖 Small, well-contained change that never inspects or redeems the invite. One recommended blocker (media origin source) and two optional notes inline.

Comment thread crates/buzz-relay/src/invite_preview.rs Resolved
Comment thread web/vite.config.ts
Comment on lines +21 to +37
{
name: "invite-preview-media",
generateBundle() {
for (const [source, output] of [
["buzz-invite-loop.mp4", "buzz-invite-loop-v1.mp4"],
["buzz-invite-poster.png", "buzz-invite-poster-v1.png"],
]) {
this.emitFile({
type: "asset",
fileName: `assets/invite-preview/${output}`,
source: readFileSync(
new URL(`../previews/invite-video/${source}`, import.meta.url),
),
});
}
},
},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🤖 Optional simplification: moving the two approved files to web/public/assets/invite-preview/ (Vite copies public/ verbatim into dist/) would remove this plugin, the readFileSync, and the Dockerfile COPY line, since web/ is already copied. The render script would write there instead.

Comment on lines +2220 to +2263
for (name, mime) in [
("buzz-invite-loop-v1.mp4", "video/mp4"),
("buzz-invite-poster-v1.png", "image/png"),
] {
let path = format!("/assets/invite-preview/{name}");
for method in ["GET", "HEAD"] {
let response = build_router(state.clone())
.oneshot(
Request::builder()
.method(method)
.uri(&path)
.header("host", "public.example")
.body(Body::empty())
.unwrap(),
)
.await
.unwrap();
assert_eq!(response.status(), StatusCode::OK);
assert_eq!(response.headers()["content-type"], mime);
assert!(
response.headers()["content-length"]
.to_str()
.unwrap()
.parse::<usize>()
.unwrap()
> 1000
);
}
let response = build_router(state.clone())
.oneshot(
Request::get(&path)
.header("host", "public.example")
.header("range", "bytes=0-31")
.body(Body::empty())
.unwrap(),
)
.await
.unwrap();
assert_eq!(response.status(), StatusCode::PARTIAL_CONTENT);
let bytes = axum::body::to_bytes(response.into_body(), usize::MAX)
.await
.unwrap();
assert_eq!(bytes.len(), 32);
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🤖 Optional: this half of the test (GET/HEAD/range on the media files, plus the real-TCP range fetch above) mostly exercises tower-http's ServeDir, not this PR's code, and include_bytes! pulls the real 1.4 MB MP4 into the test binary. Small synthetic bytes would cover the routing assertions; the metadata/host/admin-isolation assertions are the valuable part.

Co-authored-by: Terp <5856f6900e8e0a4e0ea1f4f8d2ee33e4753d2119bc122f94ecafc660b46c0511@buzz.block.builderlab.xyz>
Signed-off-by: kenny lopez <klopez4212@gmail.com>
@github-actions github-actions Bot removed the codex-security-review-current The posted Codex security review matches its recorded range. label Nov 9, 2026
@klopez4212
klopez4212 deployed to codex-review November 9, 2026 22:49 — 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 9, 2026

@TheSentinel454 TheSentinel454 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🤖 Approving at eac46e2: media origin now binds to the resolved community host and fails closed. Thanks for the quick fix.

@klopez4212
klopez4212 enabled auto-merge (squash) November 9, 2026 23:01
@klopez4212
klopez4212 merged commit 7738496 into main Nov 9, 2026
110 checks passed
@klopez4212
klopez4212 deleted the invite-og-integration-20261109 branch November 9, 2026 23:12
wpfleger96 added a commit that referenced this pull request Nov 10, 2026
…e-mode

* origin/main:
  ci(docker): skip relay image publishes for main pushes outside the build context (#9310)
  Add manual-only relay image publishing (#9303)
  fix(mobile): bump Flutter to 3.47.9 for Android TLS fix (#9309)
  Serve video and poster previews for invite links (#9306)
  docs: point the README to Buzz 1.0 in block/buzz-app (#9296)
  fix(db): give the replica-fence probe its own pool and instrument it (#9297)
  fix(relay): never close connections when cross-node fan-out falls behind (#9302)
  test: fix timing-dependent unit tests in buzz-cli, buzz-agent and buzz-admin (#9273)
  fix(ci): classify hermit retry timeouts by watchdog kill, not whole seconds (#9274)
  test(ios): wait for a key, foreground-active window before presenting in RunnerTests (#9275)
  test(desktop): wait on real readiness signals in audience and community-rail specs (#9277)

Signed-off-by: Will Pfleger <wpfleger@block.xyz>
philazar added a commit that referenced this pull request Nov 10, 2026
* origin/main:
  Add swipeable photo stacks and native iOS gallery preview (#9259)
  ci(docker): skip relay image publishes for main pushes outside the build context (#9310)
  Add manual-only relay image publishing (#9303)
  fix(mobile): bump Flutter to 3.47.9 for Android TLS fix (#9309)
  Serve video and poster previews for invite links (#9306)
  docs: point the README to Buzz 1.0 in block/buzz-app (#9296)

Signed-off-by: Philip Azar <pazar@squareup.com>
brow added a commit that referenced this pull request Nov 11, 2026
**Context:** #9306 (merged) added link-preview tags to the invite page.
To build the media URLs, the relay looks up the community for the
request host. This fixes a problem found in our review of #9306.

**Problem:** The invite page waits for that lookup with no time limit.
When the database is slow, the lookup can take as long as the pool
acquire timeout (3 s) plus the statement timeout (120 s by default).
During that time, a person who opens an invite link gets no page. Before
#9306, this page did not use the database.

**Fix:** The lookup gets 250 ms. If it does not finish, the relay sends
the page without the preview tags. A healthy indexed host lookup
finishes well inside that, so crawlers still get the tags, and nothing
else changes: the media route, the router and the build are untouched.

### Validation

- Added test: a host whose lookup never finishes gets the plain page.
Without the timeout, this test hangs (confirmed locally; it was killed
after 30 s).
- The existing `invite_preview` and router invite tests pass.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Signed-off-by: Tom Brow <tomb@squareup.com>
Co-authored-by: Tom Brow <tomb@squareup.com>
Co-authored-by: studio <dc2fc481343672df31a689840c09299972e704dac592e0da6f18486646a7ee3e@buzz.block.builderlab.xyz>

This branch was successfully deployed

1 active deployment
codex-review — eac46e23 Deployed Nov 9, 2026 by klopez4212 via Run Codex Security Review #14139
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.

2 participants