Skip to content

fix(pcs): pictures load in the Android app - #562

Merged
vaakx-dev merged 1 commit into
mainfrom
sand/fix-android-image-loading
Nov 24, 2026
Merged

vaakx-dev merged 1 commit into
mainfrom
sand/fix-android-image-loading

Conversation

@vaakx-dev

Copy link
Copy Markdown
Owner

Pictures in the Android app load again instead of showing "Image unavailable".

What

  • In the app, wire.url builds links to the home PC on the page's own origin (https://sand.localhost), which the app already proxies to the PC with route failover. Links relayed through the home PC use it too.
  • Dev servers pick the address this device reaches from the connected route in pcs, not from wire.url, so their link choice in the app is unchanged.
  • New browser test plugins/ui/chat/chat/test/web/app.ts (added to test:phone) runs the page the way the app does: https page origin proxied to the PC, PC route reachable for fetch and sockets but not for pictures.

Why

  • The app's page is https://sand.localhost, while the PC's routes are plain http:// LAN or Tailscale addresses. Signed media links pointed at those routes.
  • WebView lets fetch and WebSockets reach them under MIXED_CONTENT_ALWAYS_ALLOW, but it auto-upgrades <img> requests to https://, which the PC doesn't serve. Every picture failed twice and showed "Image unavailable": tool-read images, chat attachments and anything else signed through media.

Verification

  • Android emulator (API 35 WebView), debug APK paired with a sandbox on the PC's http route:
    • before: an <img> to the route failed with "Mixed Content … requested an insecure image … This request has been blocked".
    • after: a sent picture reloaded from https://sand.localhost/media/… with its full size, and no "Image unavailable".
  • The new browser test fails before the fix (it sees "Image unavailable") and passes after.
  • bunx tsc, vrui-check, scripts/deps.ts, scripts/comments.ts, and bun test for plugins/agent/dev-servers, plugins/devices and plugins/core/media pass.

@github-actions

github-actions Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Performance: ✅ every row is within its limit

Main 3b5bfc8 against this PR f905ff0, both measured in the same job, medians of 5 runs. Times, memory and CPU fail when the PR is more than 15% worse, bytes when they grow more than 5%; changes under 20 ms or 2 KB never fail. Logs

main PR change
Phone (4× slower CPU, 150 ms, 9 Mbit/s link)
open a chat: shows 289 ms 290 ms +0.2% ✅
open a chat: usable 308 ms 308 ms +0.1% ✅
first visit with an empty cache: usable 1.84 s 1.85 s +0.9% ✅
open a long chat: usable 274 ms 288 ms +5.0% ✅
send: your message shows 51 ms 50 ms -2.0% ✅
send: first reply text shows 278 ms 280 ms +0.8% ✅
main thread blocked over these steps 490 ms 541 ms +10.4% ✅
data on first visit 928.1 KB 928.3 KB +0.0% ✅
data per chat opened 49.5 KB 49.5 KB 0% ✅
data while idle for 20 s 220 B 220 B 0% ✅
app code a phone downloads 1.6 MB 1.6 MB +0.0% ✅
Main pages (same phone and link)
Settings: time to open 64 ms 62 ms -4.5% ✅
Settings: data to open 0 B 0 B 0% ✅
Settings: data per minute left open 600 B 600 B 0% ✅
Add-ons: time to open 75 ms 71 ms -5.1% ✅
Add-ons: data to open 100 B 100 B 0% ✅
Add-ons: data per minute left open 600 B 600 B 0% ✅
Usage: time to open 53 ms 56 ms +5.3% ✅
Usage: data to open 15.5 KB 15.5 KB 0% ✅
Usage: data per minute left open 600 B 600 B 0% ✅
Search: time to open 62 ms 64 ms +3.1% ✅
Search: data to open 0 B 0 B 0% ✅
Search: data per minute left open 600 B 600 B 0% ✅
Performance: time to open 440 ms 436 ms -1.0% ✅
Performance: data to open 840 B 884 B +5.2% ✅
Performance: data per minute left open 2.0 KB 2.0 KB +0.4% ✅
PC side
start-up until ready 4.05 s 4.05 s +0.1% ✅
memory while idle 237.7 MB 237.1 MB -0.3% ✅
CPU used over 60 s idle 350 ms 340 ms -2.9% ✅
memory after 100 scripted chat turns 274.1 MB 273.4 MB -0.2% ✅
CPU for one reply 53 ms 50 ms -5.7% ✅
search time on 100k messages 102 ms 108 ms +6.6% ✅
database size per 10k messages 19.8 MB 19.8 MB +0.0% ✅
worktree list with sizes on 40 worktrees 777 ms 778 ms +0.2% ✅
slowest other reply during a worktree list 55 ms 65 ms +18.5% ✅

The app's WebView upgrades plain-http pictures on its https page and the
upgrade fails, so every signed media link to the PC's http route showed
Image unavailable. Links to the home PC now use the page's own origin,
which the app proxies to the PC across its routes. Dev servers read the
connected route instead of wire.url to pick the address this device reaches.
@vaakx-dev
vaakx-dev force-pushed the sand/fix-android-image-loading branch from a3d91e5 to f905ff0 Compare November 24, 2026 13:54
@vaakx-dev
vaakx-dev merged commit f56922c into main Nov 24, 2026
14 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