{"record":{"id":"d1c52de336110f7c","repo":"linshenkx/prompt-optimizer","slug":"webdav-endpoint-is-required","errorCode":null,"errorMessage":"WebDAV endpoint is required","messagePattern":"WebDAV endpoint is required","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/ui/src/utils/remote-backup.ts","lineNumber":1460,"sourceCode":"        path: childPath,\n        sizeBytes: sizeText ? Number(sizeText) : undefined,\n        updatedAt: updatedAt ? new Date(updatedAt).toISOString() : undefined,\n        contentType,\n      })\n    }\n    return entries\n  }\n\n  private authHeaders(): Record<string, string> {\n    if (!this.config.username && !this.config.password) return {}\n    return {\n      Authorization: `Basic ${btoa(`${this.config.username}:${this.config.password}`)}`,\n    }\n  }\n\n  private baseUrl(): string {\n    if (!this.config.endpoint) {\n      throw new Error('WebDAV endpoint is required')\n    }\n    return `${this.config.endpoint.replace(/\\/+$/g, '')}/${encodePathSegments(this.config.directory)}/`\n  }\n\n  private directoryUrl(path: string): string {\n    const encoded = encodePathSegments(path)\n    return `${this.baseUrl()}${encoded ? `${encoded}/` : ''}`\n  }\n\n  private fileUrl(path: string): string {\n    return `${this.baseUrl()}${encodePathSegments(path)}`\n  }\n}\n\nclass DesktopIpcRemoteObjectStore extends BaseRemoteObjectStore {\n  provider: RemoteBackupProviderKind\n\n  authorize?: () => Promise<void>","sourceCodeStart":1442,"sourceCodeEnd":1478,"githubUrl":"https://github.com/linshenkx/prompt-optimizer/blob/3e677b1d9f7e0493c142c175560531e7ae786dce/packages/ui/src/utils/remote-backup.ts#L1442-L1478","documentation":"WebDavRemoteObjectStore.baseUrl() requires config.endpoint; every WebDAV request URL is built from it, so an empty endpoint throws immediately.","triggerScenarios":"Configuring a webdav provider without an endpoint field (empty string/undefined) and calling any operation (put/get/list/delete) — all construct URLs via baseUrl().","commonSituations":"Settings form saved with blank endpoint; migration/import of provider config that dropped the endpoint field; trailing config typos.","solutions":["Set the WebDAV endpoint URL (e.g. https://cloud.example.com/remote.php/dav/files/user) in the provider config","Validate endpoint before saving the config in the UI","Ensure config import/export preserves the endpoint field"],"exampleFix":"// before\n{ kind: 'webdav', endpoint: '', directory: 'backups', ... }\n// after\n{ kind: 'webdav', endpoint: 'https://cloud.example.com/remote.php/dav/files/user', directory: 'backups', ... }","handlingStrategy":"validation","validationCode":"if (!providerConfig.endpoint?.trim()) blockSave('WebDAV endpoint is required')","typeGuard":"const isWebDavConfigValid = (c: RemoteBackupProviderConfig): boolean => c.kind !== 'webdav' || Boolean(c.endpoint && c.endpoint.trim())","tryCatchPattern":null,"preventionTips":["Validate provider forms before persisting","Require endpoint field in UI for webdav"],"tags":["webdav","configuration","endpoint"],"backgroundTag":"missing-configuration","analyzedSha":"3e677b1d9f7e0493c142c175560531e7ae786dce","analyzedAt":"2026-08-27T21:29:16.709Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}