{"record":{"id":"c01a6ed831aa3e3a","repo":"linshenkx/prompt-optimizer","slug":"google-drive-remote-backup-is-only-supported-in-th","errorCode":null,"errorMessage":"Google Drive remote backup is only supported in the Web version","messagePattern":"Google Drive remote backup is only supported in the Web version","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/ui/src/utils/remote-backup.ts","lineNumber":1724,"sourceCode":"    }\n  }\n}\n\nclass CloudflareR2RemoteObjectStore extends S3CompatibleRemoteObjectStore {\n  provider: RemoteBackupProviderKind = 'cloudflare-r2'\n\n  constructor(config: Extract<RemoteBackupProviderConfig, { kind: 'cloudflare-r2' }>) {\n    super(toCloudflareR2S3Config(config))\n  }\n}\n\nexport const createRemoteObjectStore = (\n  provider: RemoteBackupProviderConfig,\n  runtime: RemoteBackupRuntime = 'web',\n): RemoteObjectStore => {\n  if (runtime === 'desktop') {\n    if (provider.kind === 'google-drive') {\n      throw new Error('Google Drive remote backup is only supported in the Web version')\n    }\n    return new DesktopIpcRemoteObjectStore(provider)\n  }\n  if (provider.kind === 'google-drive') return new GoogleDriveRemoteObjectStore(provider)\n  if (provider.kind === 'cloudflare-r2') return new CloudflareR2RemoteObjectStore(provider)\n  if (provider.kind === 'webdav') return new WebDavRemoteObjectStore(provider)\n  return new S3CompatibleRemoteObjectStore(provider)\n}\n\nexport const createRemoteBackupAdapter = (\n  provider: RemoteBackupProviderConfig,\n  runtime: RemoteBackupRuntime = 'web',\n): RemoteBackupAdapter => createRemoteObjectStore(provider, runtime) as RemoteBackupAdapter\n\nexport const remoteBackupBlobToImportBuffer = async (blob: Blob): Promise<ArrayBuffer> =>\n  blob.arrayBuffer()\n\nexport const remoteBackupArrayBufferToText = (buffer: ArrayBuffer): string =>","sourceCodeStart":1706,"sourceCodeEnd":1742,"githubUrl":"https://github.com/linshenkx/prompt-optimizer/blob/3e677b1d9f7e0493c142c175560531e7ae786dce/packages/ui/src/utils/remote-backup.ts#L1706-L1742","documentation":"Factory createRemoteObjectStore routes desktop runtimes through the Electron IPC store, which has no Google Drive implementation; requesting google-drive on desktop throws explicitly.","triggerScenarios":"Calling createRemoteObjectStore({kind:'google-drive',...}, 'desktop') — i.e. the desktop app flow with Google Drive selected as the backup provider.","commonSituations":"Desktop build where the Google Drive OAuth flow (browser-based) is not wired through IPC; users migrating settings from web to desktop with a Google Drive provider configured.","solutions":["Use the web version for Google Drive backups","Choose an IPC-supported provider on desktop (webdav, cloudflare-r2/s3)","Hide/disable the Google Drive option in desktop UI before reaching the factory"],"exampleFix":"// before\nconst store = createRemoteObjectStore(cfg, runtime)\n// after\nif (runtime === 'desktop' && cfg.kind === 'google-drive') {\n  throw new Error('unsupported in desktop build') // or disable the option in UI\n}\nconst store = createRemoteObjectStore(cfg, runtime)","handlingStrategy":"validation","validationCode":"if (runtime === 'desktop' && provider.kind === 'google-drive') disableGoogleDriveOption()","typeGuard":"const isProviderSupportedOnRuntime = (kind: RemoteBackupProviderKind, runtime: RemoteBackupRuntime): boolean => !(runtime === 'desktop' && kind === 'google-drive')","tryCatchPattern":"catch (e) { if ((e as Error).message.includes('only supported in the Web version')) showPlatformNotice(); else throw e }","preventionTips":["Filter provider options by runtime in UI","Keep a capability matrix per provider/runtime"],"tags":["google-drive","desktop","runtime-unsupported","factory"],"backgroundTag":"unsupported-operation","analyzedSha":"3e677b1d9f7e0493c142c175560531e7ae786dce","analyzedAt":"2026-08-27T21:29:16.709Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}