OverviewFilesCommitsIssuesDocsReleasesPeers

favela-surface-android commits / be16f6e

0.0.48: carry favela-surface 0.0.68 + verify the bundle carries static/
favela-surface read static/ off disk; bare-pack packs only imports, so on the phone every /static/*.js was a 404 — no composer pyramid, so photos reached bsky without the image. 0.0.68 imports them as text. The prebuild step now runs scripts/verify-bundle-static.mjs on the BUILT bundle: every surface static file present and byte-identical, or the build fails (it failed all 9 on 0.0.47's). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
be16f6eaeda6c056e353aead2dd65721696de77f
by plankatron <fleeky@gmail.com> · 2026-10-15T00:01:10.000Z

Changed files (3) +54 -1

.pear-git/ci.yaml +4 -0
……@@ -80,6 +80,10 @@ steps:
8080 # build even with the deps step fixed. An assertion pointed at a path nobody writes tests
8181 # the assertion, not the build.
8282 test -s android/app/src/main/assets/worklet.bundle
83 # ⛔ The surface's browser files must be IN the bundle. bare-pack packs only imports, and the
84 # surface once read static/ off disk at runtime — inside the bundle that was every /static/*.js
85 # a 404 on the phone, so photos went up with no pyramid and reached bsky without the image.
86 bare scripts/verify-bundle-static.mjs android/app/src/main/assets/worklet.bundle
8387 timeout: 900
8488
8589 - name: assemble
package.json +2 -1
……@@ -1,6 +1,6 @@
11{
22 "name": "favela-surface-android",
3 "version": "0.0.47",
3 "version": "0.0.48",
44 "description": "favela-surface-android \u2014 a React Native shell over a bare-kit worklet running a full favela-peer node (markdown records) with favela-surface rendering its pages in a WebView, and the atproto half composed in through favela-host.",
55 "type": "module",
66 "private": true,
……@@ -64,6 +64,7 @@
6464 "@react-native-community/cli": "^20.2.0",
6565 "@react-native/babel-preset": "^0.86.2",
6666 "@react-native/metro-config": "^0.86.2",
67 "bare-bundle": "^1.10.0",
6768 "bare-fetch": "^3.0.1",
6869 "brittle": "^4.0.2"
6970 }
scripts/verify-bundle-static.mjs +48 -0
……@@ -0,0 +1,48 @@
1// Verify the BUILT worklet bundle carries every browser file favela-surface serves.
2//
3// ⛔ WHY THIS EXISTS. favela-surface used to fill its /static/ map by reading its own static/ directory
4// at boot. On a desktop that directory is on disk. In this app the surface runs from worklet.bundle,
5// and bare-pack packs only what the module graph IMPORTS — a directory read at runtime is invisible to
6// it. So readdirSync failed inside the bundle, the try/catch turned that into an empty list, and every
7// /static/*.js on the phone was a 404:
8//
9// composer.js never ran, so a photo posted from the phone was ONE level with no pyramid. A 2,645,504
10// byte photo then had no level under bsky's 2,000,000 ceiling and the bridge withheld
11// it — the post reached bsky with no image while Mastodon (no ceiling) showed it.
12// the @-picker, explore's three.js, the anproto client — all silently absent the same way.
13//
14// Nothing reported it: a module script that 404s is a page that quietly does nothing. favela-surface now
15// imports static/ as text modules so bare-pack sees them; this reads the ARTIFACT so a regression fails
16// the build instead of a handset.
17//
18// Usage: bare scripts/verify-bundle-static.mjs [path/to/worklet.bundle]
19import fs from 'bare-fs'
20import path from 'bare-path'
21import process from 'bare-process'
22import b4a from 'b4a'
23import Bundle from 'bare-bundle'
24
25const bundlePath = process.argv[2] || 'android/app/src/main/assets/worklet.bundle'
26const staticDir = path.resolve('node_modules/favela-surface/static')
27
28const bundle = Bundle.from(fs.readFileSync(bundlePath))
29const files = fs.readdirSync(staticDir).filter((f) => f.endsWith('.js')).sort()
30if (!files.length) {
31 console.error('verify-bundle-static: no .js files in ' + staticDir + ' — wrong directory, not a pass')
32 process.exit(1)
33}
34
35const missing = []
36const differ = []
37for (const f of files) {
38 const key = '/node_modules/favela-surface/static/' + f
39 if (!bundle.exists(key)) { missing.push(f); continue }
40 if (!b4a.equals(bundle.read(key), fs.readFileSync(path.join(staticDir, f)))) differ.push(f)
41}
42
43if (missing.length || differ.length) {
44 if (missing.length) console.error('verify-bundle-static: NOT in ' + bundlePath + ': ' + missing.join(', '))
45 if (differ.length) console.error('verify-bundle-static: bytes DIFFER from static/: ' + differ.join(', '))
46 process.exit(1)
47}
48console.log('verify-bundle-static: all ' + files.length + ' favela-surface static files are in ' + bundlePath)