Skip to content

fix(google-meet): publish exports atomically - #122306

Merged
steipete merged 1 commit into
mainfrom
fix/google-meet-export-atomic
Aug 11, 2026
Merged

steipete merged 1 commit into
mainfrom
fix/google-meet-export-atomic

Conversation

@steipete

@steipete steipete commented Aug 11, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Closes #122276.

Google Meet export wrote every completed artifact directly to its final path. Re-exporting to an existing directory or ZIP therefore truncated the previous artifact before the replacement was safely published; a filesystem failure or process interruption could destroy the prior valid export and leave partial bytes at the final path.

Why This Change Was Made

The Google Meet plugin now routes all six directory members and the optional ZIP through the existing openclaw/plugin-sdk/security-runtime writeExternalFileWithinRoot contract. That public plugin seam writes to a randomized sibling staging file, validates the staged regular-file identity, syncs it, atomically renames it over the final path, syncs the parent directory, and cleans failed staging files.

This keeps the repair at the plugin-owned export boundary without adding a dependency, SDK surface, compatibility path, or second publication implementation.

User Impact

A failed Google Meet export replacement no longer corrupts the previous artifact at that path. Successful exports retain the same CLI and plugin result shape, while both folder members and ZIP archives become visible only after their complete bytes have been staged.

Evidence

  • Real filesystem reproduction before the fix, using a 2 KiB process file limit: the replacement failed with EFBIG and the previous 18-byte summary.md was replaced by a corrupt 2,048-byte partial file.
  • The same reproduction after the fix: EFBIG still propagates, the previous file remains byte-identical at 18 bytes, and the export directory contains only summary.md with no staging residue.
  • New owner-boundary regressions inject partial writes before throwing for both a directory member and the ZIP. Both tests failed against the direct-write implementation for the intended corruption reason, then passed after staged publication.
  • node scripts/run-vitest.mjs extensions/google-meet/src/cli-export.test.ts extensions/google-meet/src/cli-artifacts.test.ts — 19 passed.
  • node scripts/run-vitest.mjs extensions/google-meet — 25 files, 334 tests passed.
  • pnpm tsgo:extensions && pnpm tsgo:extensions:test — passed.
  • Targeted extension Oxlint and formatting checks — passed.
  • Mandatory Codex autoreview and TruffleHog — clean, no accepted/actionable findings.
  • Delegated changed-file gate Testbox run https://github.com/openclaw/openclaw/actions/runs/31537828610 timed out during checkout hydration before running repository checks. The trusted-source local fallback passed every lane through plugin boundaries, then stopped because the pre-existing Knip pnpm-store link remained missing after the required install/retry.
  • Exact-head CI parent https://github.com/openclaw/openclaw/actions/runs/31541187794 completed successfully for 8fc2e1c44373ffab501c4d945fdc382a7c4e4df8.
  • Native review artifacts validated READY FOR /prepare-pr with zero findings, and OPENCLAW_TESTBOX=1 scripts/pr prepare-run 122306 completed with hosted gates passed.

Production LOC: +16/-4 (net +12). Tests: +88/-0 (net +88).

@clawsweeper

clawsweeper Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@steipete
steipete marked this pull request as ready for review August 11, 2026 22:09
@steipete

Copy link
Copy Markdown
Contributor Author

Land-ready verification for 8fc2e1c44373ffab501c4d945fdc382a7c4e4df8:

  • Confirmed the current-main defect at writeMeetExportBundle: direct final-path writes truncate existing Google Meet bundle members and ZIP archives before replacement bytes are complete.
  • Accepted the canonical plugin-owner repair: every export artifact publishes through openclaw/plugin-sdk/security-runtime sibling staging, with staged regular-file/identity validation, file sync, atomic rename, parent sync, and failed-stage cleanup from installed @openclaw/fs-safe 0.5.4.
  • Real filesystem proof with a 2 KiB process file limit: pre-fix EFBIG replaced the previous 18-byte summary.md with a corrupt 2,048-byte partial file; post-fix the same error propagates while the prior file remains byte-identical at 18 bytes and no staging residue remains.
  • New regressions inject partial bytes before throwing for both a directory member and the ZIP. Both failed against direct writes for the intended corruption reason and pass after staged publication.
  • Focused export/CLI proof: node scripts/run-vitest.mjs extensions/google-meet/src/cli-export.test.ts extensions/google-meet/src/cli-artifacts.test.ts — 19 passed.
  • Full Google Meet plugin proof: node scripts/run-vitest.mjs extensions/google-meet — 25 files, 334 tests passed.
  • pnpm tsgo:extensions && pnpm tsgo:extensions:test, targeted extension Oxlint/formatting, mandatory Codex autoreview, and TruffleHog all passed.
  • Blacksmith Testbox run https://github.com/openclaw/openclaw/actions/runs/31537828610 timed out during checkout hydration before executing repository checks. The trusted local fallback passed through plugin boundaries, then hit the pre-existing missing Knip pnpm-store link after the required install/retry; no patch failure was observed.
  • Exact-head CI parent https://github.com/openclaw/openclaw/actions/runs/31541187794 completed successfully.
  • Native review artifacts validated READY FOR /prepare-pr with zero findings, and OPENCLAW_TESTBOX=1 scripts/pr prepare-run 122306 completed with hosted gates passed.
  • Production LOC is +16/-4 (net +12) for the shared publication helper and two call-site replacements. Tests are +88/-0.

ClawSweeper has only published its acknowledgement so far; there are no review findings or rank-up moves to apply, and landing is not blocked on the late review publisher.

@steipete
steipete merged commit c4fd5ad into main Aug 11, 2026
165 checks passed
@steipete
steipete deleted the fix/google-meet-export-atomic branch August 11, 2026 22:29
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Aug 11, 2026
* origin/main: (1725 commits)
  fix(agents): preserve reply cleanup when cancellation throws (#122252)
  fix(ui): render disallowed link schemes as plain text (#122311)
  fix(test): isolate gateway helper env stubs (#122319)
  fix(ui): keep chat Markdown block rhythm consistent (#122289)
  test(cli): trim duplicate Hooks process cases (#122278)
  fix(ui): retain identity while agent roster loads
  fix(ui): preserve configured agent labels
  fix(plugins): keep startup convergence read-only (#122330)
  fix: preserve WebChat reply context after reloads (#122169)
  fix(ui): make DONE moves visibly reversible (#122303)
  fix(ui): keep inline-code punctuation attached (#122291)
  fix(google-meet): publish exports atomically (#122306)
  fix(channels): preserve failed agent run reactions (#122009)
  fix(ui): label patch file operations accurately (#122287)
  fix(windows): preserve Unicode LAN route aliases (#122263)
  test(media): synchronize transcode pool completion (#122279)
  fix(android): keep completed subagent activity visible for sixty seconds (#122089)
  fix(ui): humanize bare GitHub item links (#122285)
  refactor(qqbot): install plugin from Tencent package (#107295)
  chore: scope SQLite session lifecycle CI (#121917)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 12, 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.

[Bug]: Google Meet export can corrupt existing artifacts on write failure

1 participant