Skip to content

fix(main): cherry-pick #12936 — export Filesystem/Share from build:web native stubs (unbreaks prod Pages deploys) - #12985

Merged
lalalune merged 1 commit into
mainfrom
fix/main-capacitor-stub-exports
Jul 4, 2026
Merged

fix(main): cherry-pick #12936 — export Filesystem/Share from build:web native stubs (unbreaks prod Pages deploys)#12985
lalalune merged 1 commit into
mainfrom
fix/main-capacitor-stub-exports

Conversation

@NubsCarson

Copy link
Copy Markdown
Member

What

Cherry-pick of a06ad22 (#12936, already merged to develop) onto main.

Why main needs it now

Scope

  • Single file, +18 lines, identical to the develop commit (cherry-picked with -x).
  • Stubs are fail-loud (every method throws "mobile-only"), no fabricated success — consistent with the fallback-slop policy.
  • Migrations + API Worker jobs are unaffected (they already pass); this only unbreaks the two Pages builds.

The next develop→main promote would carry this anyway; this PR just closes the window where prod front-end deploys from main are build-broken.

[cloud-security]

build:web failed with 'Filesystem is not exported by native-stub:@capacitor/filesystem'
because src/ios-attachment-smoke.ts statically imports { Filesystem } from
@capacitor/filesystem and { Share } from @capacitor/share, but the native-module
stub plugin emitted only a default noop object for those packages.

Add explicit named Filesystem/Share exports to the stubs. Every method throws
(mobile-only) rather than silently no-opping, so a web/desktop code path can
never fabricate a successful file write or share.

Also export isSensitiveKeyName/redactLogArgs from core index.browser.ts
(superseded by develop's export * from ./security/redact — resolved at merge).

(cherry picked from commit a06ad22)

@greptile-apps greptile-apps Bot 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.

Your trial has ended. Reactivate Greptile to resume code reviews.

@coderabbitai

coderabbitai Bot commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c09d4f3e-2158-48a5-9166-816d024ee0ab

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/main-capacitor-stub-exports

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@lalalune

lalalune commented Jul 4, 2026

Copy link
Copy Markdown
Member

Local validation for the main hotfix cherry-pick:

  • PASS: git diff --check origin/main...HEAD
  • PASS: bunx @biomejs/biome check packages/app/vite/native-module-stub-plugin.ts
  • PASS: git diff --no-ext-diff --exit-code a06ad2211b3cc89ff09d2b5b6faba6cfb9cc13e7 HEAD -- packages/app/vite/native-module-stub-plugin.ts
    • Confirms the touched stub file is identical to the already-merged develop fix from #12936.
  • PASS: direct Vite plugin check for @capacitor/filesystem and @capacitor/share
    • Both imports resolve to \0native-stub:* when isCapacitorMobileBuild: false.
    • Generated modules include the required named exports (Filesystem, Share) and mobile-only throwing behavior.

Attempted but blocked locally:

  • bun run --cwd packages/app build:web did not reach app bundling in this sparse worktree because Vite config loading failed before the PR code path: the available installed dependency trees are missing @tailwindcss/vite. A local bun install --frozen-lockfile --ignore-scripts is also blocked by the sparse checkout omitting unrelated root workspaces.

Given this is a one-file cherry-pick of the develop fix and the generated stub output verifies the missing Rollup named exports directly, the risk is limited to the intended deployment unblock.

@lalalune lalalune left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Validated as a main hotfix cherry-pick of the already-merged #12936 native-stub fix.

Local checks:

  • git diff --check origin/main...HEAD && git diff --check
  • bunx @biomejs/biome check packages/app/vite/native-module-stub-plugin.ts
  • direct smoke confirmed @capacitor/filesystem exports Filesystem/default and @capacitor/share exports Share/default from the stub source
  • bunx vitest run packages/app/test/native-module-stub-plugin.test.ts passed

App visual audit is N/A for this PR: Vite build-time native module stubs only; no app UI/rendering path changed.

@lalalune
lalalune merged commit 57fc0d8 into main Jul 4, 2026
18 of 41 checks passed
@lalalune
lalalune deleted the fix/main-capacitor-stub-exports branch July 4, 2026 05:58
@lalalune

lalalune commented Jul 4, 2026

Copy link
Copy Markdown
Member

Validated the main-branch cherry-pick locally against fresh main (github-main-fresh).

What I checked:

  • Confirmed the commit is the same native-stub export change already present on fresh develop via a06ad2211b3cc89ff09d2b5b6faba6cfb9cc13e7.
  • git diff --check github-main-fresh...HEAD -- packages/app/vite/native-module-stub-plugin.ts passed.
  • bunx @biomejs/biome check packages/app/vite/native-module-stub-plugin.ts passed.
  • bun run --cwd packages/app build:web passed and reached a normal completed Vite build:
    • no missing Filesystem / Share export failure
    • [renderer-build-manifest] wrote eliza-renderer-build.json buildId=bf439cdc3db4 (424 assets)
    • [verify-chunk-safety] OK: bn.js/crypto graph is confined to lazy vendor chunks (392 current chunks scanned).

I did not run audit:app because this is a Vite build-time native-module stub change only; it does not alter rendered app UI. Local worktree stayed clean after validation. GitHub checks are still queued and mergeStateStatus is currently UNKNOWN, so I’m leaving this for CI/mergeability to settle before merge.

NubsCarson added a commit that referenced this pull request Jul 4, 2026
…ges build (#13013)

The #12848 promote brought packages/cloud/shared/src/lib/utils/logger.ts,
which imports isSensitiveKeyName/redactLogArgs from @elizaos/core, but the
matching core browser-barrel export (export * from "./security/redact" in
packages/core/src/index.browser.ts) landed on develop in #12919 minutes
AFTER the promote cut. Result: build:web fails on main with
'"isSensitiveKeyName" is not exported by core dist/browser', so both
prod Pages projects (eliza-cloud / eliza-app) cannot deploy from main —
same skew class as #12985.

One-file, additive-only cherry-pick of the index.browser.ts hunk from
develop commit f317d1c (#12919). Verified locally at main tip:
bun run build:core green, packages/app build:web green,
verify-chunk-safety OK (392 chunks scanned).
@github-actions github-actions Bot added the ui label Jul 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants