HALO CRM research
Real and working
Domain 1 · content · ~2,500 LOC

Shared Drive / content pipeline

Google Drive v3 over REST with a stored OAuth refresh token. A cron reconciles because creators upload via share link so nothing tells the CRM a file arrived. The folder taxonomy in Drive is the source of truth, provisioning is idempotent, and the index holds unused content only.

What it is and how it feeds the rest

Mechanically

Google Drive v3 over REST with a stored OAuth refresh token. A cron reconciles because creators upload via share link so nothing tells the CRM a file arrived. The folder taxonomy in Drive is the source of truth, provisioning is idempotent, and the index holds unused content only.

How it connects

The actual product. Consumes creator identity; supplies content state to the dashboard.

Worth knowing

The strongest engineering in the repo. markUsed moves the file in Drive BEFORE dropping the index row; inverting that would lose the file from the CRM while leaving it unused in Drive.

Pages

  • src/pages/SharedDrive.tsx
  • src/pages/CreatorUpload.tsx

Components

  • src/components/shared-drive/

Convex modules

  • driveClient.ts
  • googleDrive.ts
  • driveScan.ts
  • driveIndex.ts
  • driveContent.ts
  • driveStructure.ts
  • crons.ts

Tables

  • driveCreatorFolders
  • driveFiles
  • driveCreatorStats

Findings that touch this domain

medium Drive thumbnails stored unprocessed — phone photos carry GPS EXIF. Audit before building.

convex/driveScan.ts:252-253

medium Drive provisioning is fire-and-forget with no retry; a Drive 500 becomes silent manual work

convex/googleDrive.ts:344-380

critical Four public unauthenticated actions mint a live Google Workspace token and act on the real Drive; trashDriveItem takes any fileId with no ownership check

convex/googleDrive.ts:77,117,155 + driveContent.ts:83; token at driveClient.ts:53-66; folder IDs via public driveIndex.ts:127

high resetIndex is a public mutation wiping the Drive index + every cached thumbnail; the module already imports internalMutation, so this is an oversight

convex/driveScan.ts:326 (internalMutation imported at :3)

Open questions

Research priority for this domain is medium. Agent findings splice in below this line and survive regeneration.