Skip to content

Use Cap titles for Google Drive filenames - #2188

Merged
richiemcilroy merged 4 commits into
mainfrom
codex/google-drive-video-titles
Sep 2, 2026
Merged

Use Cap titles for Google Drive filenames#2188
richiemcilroy merged 4 commits into
mainfrom
codex/google-drive-video-titles

Conversation

@richiemcilroy

@richiemcilroy richiemcilroy commented Sep 2, 2026

Copy link
Copy Markdown
Member

Summary

  • Name Google Drive video folders and final MP4s from Cap titles without changing file IDs, storage keys, or existing links.
  • Synchronize later manual and automatic title changes, duplication, and ownership transfers through retryable workflows.
  • Preserve existing Drive names during content overwrites and validate exact storage mappings before renaming.
  • Reserve missing-file replacements atomically and reject stale upload or recovery mappings.

Validation

  • 84 focused web tests and 23 mobile API/title-action tests passed.
  • Backend and web TypeScript, scoped Biome, and diff checks passed.
  • A name-only rename regression verifies that Drive version ETags advance while media IDs, sizes, checksums, parents, and app properties remain unchanged.
  • A metadata-only backfill was verified against original IDs, parent folders, permissions, sizes, and checksums; customer data and migration scripts are excluded from this PR.

No schema migration is required. Workflow-dispatch failures are logged without undoing saved Cap titles; a missed dispatch may require a later title change or manual retry.

Pending uploads retain their reserved Drive ID; permanently unusable abandoned reservations require explicit recovery.

Greptile Summary

This PR names Google Drive video folders and final MP4 files from Cap titles while retaining stable storage mappings and provider identities.

  • Propagates initial, manual, generated, duplicated, and transferred titles through retryable synchronization workflows.
  • Adds guarded metadata updates, exact Drive-object verification, and atomic replacement reservations.
  • Adds focused coverage for naming, overwrite preservation, recovery, concurrency, and stale-mapping behavior.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains; the replacement provider ID is now claimed through a conditional database update before the Drive object is created, preventing concurrent recreation from splitting file identity.

Important Files Changed

Filename Overview
packages/web-backend/src/Storage/GoogleDrive.ts Adds title-aware naming and verified synchronization while atomically reserving missing-file replacements, resolving the previously reported concurrent recreation race.
packages/web-backend/src/Storage/StorageRepo.ts Adds conditional storage-object updates and provider-scoped deletion to prevent stale workflows from replacing newer mappings.
packages/web-backend/src/Storage/index.ts Wires title propagation and rejects stale recovery updates against active pending mappings.
apps/web/lib/sync-video-storage-names.ts Dispatches synchronization workflows only for videos backed by a storage integration and logs non-fatal dispatch failures.
apps/web/workflows/sync-video-storage-names.ts Implements delayed retry behavior for transient upload and synchronization states.
apps/web/tests/unit/google-drive-storage.test.ts Covers title naming, metadata preservation, missing-file replacement serialization, stale finalization, recovery, and rename verification.

Reviews (3): Last reviewed commit: "fix: reconcile Drive filename and versio..." | Re-trigger Greptile

@superagent-security

Copy link
Copy Markdown

🚨 Contributor flagged. Click here for more info: Superagent Dashboard

Comment thread packages/web-backend/src/Storage/GoogleDrive.ts
@richiemcilroy

Copy link
Copy Markdown
Member Author

hey @greptileai, please re-review the PR

@richiemcilroy

Copy link
Copy Markdown
Member Author

hey @greptileai, please re-review the PR

@richiemcilroy
richiemcilroy merged commit 27f3f24 into main Sep 2, 2026
23 of 24 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