{"record":{"id":"0c660cd811b6e79c","repo":"IceWhaleTech/CasaOS","slug":"not-support","errorCode":null,"errorMessage":"not support","messagePattern":"not support","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"drivers/dropbox/drive.go","lineNumber":89,"sourceCode":"\t\treturn \"\", err\n\t}\n\tlogger.Info(\"resp\", zap.Any(\"resp\", string(resp)))\n\treturn user.Email, nil\n}\nfunc (d *Dropbox) MakeDir(ctx context.Context, parentDir model.Obj, dirName string) error {\n\treturn nil\n}\n\nfunc (d *Dropbox) Move(ctx context.Context, srcObj, dstDir model.Obj) error {\n\treturn nil\n}\n\nfunc (d *Dropbox) Rename(ctx context.Context, srcObj model.Obj, newName string) error {\n\treturn nil\n}\n\nfunc (d *Dropbox) Copy(ctx context.Context, srcObj, dstDir model.Obj) error {\n\treturn errors.New(\"not support\")\n}\n\nfunc (d *Dropbox) Remove(ctx context.Context, obj model.Obj) error {\n\treturn nil\n}\n\nfunc (d *Dropbox) Put(ctx context.Context, dstDir model.Obj, stream model.FileStreamer, up driver.UpdateProgress) error {\n\treturn nil\n}\nfunc (d *Dropbox) GetInfo(ctx context.Context) (string, string, string, error) {\n\treturn \"\", \"\", \"\", nil\n}\n\nvar _ driver.Driver = (*Dropbox)(nil)\n","sourceCodeStart":71,"sourceCodeEnd":104,"githubUrl":"https://github.com/IceWhaleTech/CasaOS/blob/0d3b2f444ec0193193cf03eef6d43c6e35b0183e/drivers/dropbox/drive.go#L71-L104","documentation":"Dropbox driver's Copy operation is intentionally unimplemented: it returns a static error 'not support' instead of calling the Dropbox API. This is a driver capability gap, not a runtime/network failure. Any code path that tries to copy a file onto Dropbox will always fail with this error.","triggerScenarios":"Calling Dropbox.Copy(ctx, srcObj, dstDir) — e.g. a file-manager 'copy' action on a Dropbox mount. The method body is only 'return errors.New(\"not support\")', so every invocation fails deterministically.","commonSituations":"A UI or API layer exposes copy for all storage drivers uniformly and the user copies a file on a Dropbox storage. Also triggered by batch/duplicate operations that fall through to Copy when the destination differs from the source.","solutions":["Disable/hide the copy action for the Dropbox driver in the frontend or caller (check the driver type before invoking Copy).","Implement Copy using the Dropbox API 'files/copy_v2' endpoint (POST https://api.dropbox.com/2/files/copy_v2 with from_path and to_path).","As a stopgap, emulate copy client-side: download the object with Get and re-upload it with Put into the destination directory."],"exampleFix":"// before\nfunc (d *Dropbox) Copy(ctx context.Context, srcObj, dstDir model.Obj) error {\n\treturn errors.New(\"not support\")\n}\n\n// after\nfunc (d *Dropbox) Copy(ctx context.Context, srcObj, dstDir model.Obj) error {\n\t_, err := d.request(\"https://api.dropboxapi.com/2/files/copy_v2\", http.MethodPost, func(req *resty.Request) {\n\t\treq.SetBody(base.Json{\n\t\t\t\"from_path\": srcObj.GetPath(),\n\t\t\t\"to_path\":   stdpath.Join(dstDir.GetPath(), srcObj.GetName()),\n\t\t})\n\t}, nil)\n\treturn err\n}","handlingStrategy":"validation","validationCode":"// Skip copy for drivers that do not implement it\nfunc CanCopy(d model.Driver) bool {\n\t_, ok := d.(*dropbox.Dropbox)\n\treturn !ok\n}\n\nif !CanCopy(d) { return errors.New(\"copy is not supported on this storage\") }\nerr := d.Copy(ctx, src, dst)","typeGuard":null,"tryCatchPattern":"if err := d.Copy(ctx, src, dst); err != nil {\n\tif strings.Contains(err.Error(), \"not support\") {\n\t\t// surface a user-facing 'unsupported operation' message, do not retry\n\t\treturn model.ErrUnsupported\n\t}\n\treturn err\n}","preventionTips":["Expose driver capability flags (supportsCopy) instead of failing at call time","Hide copy UI actions for drivers with unimplemented operations","Run a capability matrix test across all drivers in CI"],"tags":["dropbox","driver","unimplemented","copy"],"backgroundTag":null,"analyzedSha":"0d3b2f444ec0193193cf03eef6d43c6e35b0183e","analyzedAt":"2026-08-15T13:27:57.821Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}