Skip to content

fix(file-transfer): reconnect signaling + branded OG/app icons - #66

Merged
slaveofcode merged 3 commits into
developfrom
fix/file-transfer-reconnect
Aug 1, 2026
Merged

fix(file-transfer): reconnect signaling + branded OG/app icons#66
slaveofcode merged 3 commits into
developfrom
fix/file-transfer-reconnect

Conversation

@slaveofcode

@slaveofcode slaveofcode commented Aug 1, 2026

Copy link
Copy Markdown
Owner

Two fixes from testing the file-transfer link share:

1. Peer stuck on 'Waiting for the other device to join…'

On mobile the sender gets the link, switches apps to share it → backgrounding closes the sender's signaling WebSocket → the receiver opens the link alone → becomes host → waits forever (no reconnect).

  • Reconnect signaling on close/error and on tab foreground (visibilitychange) until the P2P channel is up.
  • Once connected, ignore signaling peer-left/close (transfer no longer needs signaling); a real P2P drop stays terminal.
  • Keepalive ping (25s) with a Durable Object setWebSocketAutoResponse('ping','pong') — not relayed. Re-verified DO relay + ping via local wrangler dev.

2. Blank/black share preview

Default og:image was /icon-512.png — a 512×512 essentially-black square — with a summary_large_image card. Replaced with a proper branded 1200×630 public/og.png (generated via sharp) + og:image:width/height/alt. Fixes previews site-wide.

539 tests · lint clean · build green.

🤖 Generated with Claude Code

…ing'

Root cause: on mobile, the sender opens the tool, gets the link, then switches
apps to share it — backgrounding the browser closes the sender's signaling
WebSocket. When the receiver later opens the link it's alone in the room →
becomes host → 'Waiting for the other device to join…' forever, because there
was no reconnect.

Fix:
- Reconnect the signaling socket on close/error and on tab foreground
  (visibilitychange), until the P2P data channel is established. Robust to
  either peer being first (WebRTC role already decoupled from send/receive).
- Once the P2P channel is open, ignore signaling peer-left/close (transfer is
  independent of signaling by then); a real P2P drop after connect is terminal.
- Keepalive: client pings every 25s; the Durable Object auto-responds 'pong'
  (setWebSocketAutoResponse) without waking or relaying it — prevents idle proxy
  timeouts. Manual (serverless) mode unaffected (no reconnect needed).

DO relay + ping/pong auto-response re-verified via local wrangler dev.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 1, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
goodwebtools b9af331 Aug 01 2026, 04:15 AM

Share previews (WhatsApp/Twitter/etc.) showed a blank/black box because the
default og:image was /icon-512.png — a 512x512 square that is essentially solid
black — while the card type is summary_large_image (expects ~1200x630).

Add a proper branded 1200x630 OG image (public/og.png, generated by
scripts/make-og-image.mjs via sharp — brutalist cream + violet GWT badge +
wordmark + tagline), set it as the default in Base.astro, and add
og:image:width/height/alt. Fixes previews site-wide, not just file transfer.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@slaveofcode slaveofcode changed the title fix(file-transfer): reconnect signaling so the peer isn't stuck 'waiting' fix(file-transfer): reconnect signaling + real OG share image Aug 1, 2026
icon-192.png / icon-512.png were near-black squares — so the installed PWA
icon and any og:image fallback were blank. Regenerate them with the GWT brand
(full-bleed violet, white 'GWT' kept inside the maskable safe zone since the
manifest marks them purpose 'any maskable'), add a dedicated 180x180
apple-touch-icon.png, and point <link rel=apple-touch-icon> at it. Generated by
scripts/make-icons.mjs via sharp.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@slaveofcode slaveofcode changed the title fix(file-transfer): reconnect signaling + real OG share image fix(file-transfer): reconnect signaling + branded OG/app icons Aug 1, 2026
@slaveofcode
slaveofcode merged commit 7695c29 into develop Aug 1, 2026
1 of 2 checks passed
@slaveofcode
slaveofcode deleted the fix/file-transfer-reconnect branch August 1, 2026 04:14
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