-
Notifications
You must be signed in to change notification settings - Fork 18
Description
Same issue as #15 (Huawei OBS), but for Google Cloud Storage.
Problem
GoogleCloudStorage.List() in oss/gcsblob/gcs.go does not append a trailing slash to the prefix before listing
objects. This causes prefix collisions when multiple directories share a common prefix.
In dify-plugin-daemon, plugin/ and plugin_packages/ both exist in the same bucket. When List("plugin") is
called, GCS returns objects from both prefixes. After TrimPrefix, objects from plugin_packages/ become
_packages/... which produces invalid plugin identifiers.
ERROR dify-plugin-daemon installed_bucket.go:81 failed to create PluginUniqueIdentifier from path
path=_packages/lifull/my_plugin:0.0.1@e5bc5c2c...
error="plugin_unique_identifier is not valid"
Fix
Add the same slash suffix guard that the S3 implementation already has:
func (g *GoogleCloudStorage) List(prefix string) ([]oss.OSSPath, error) {
if !strings.HasSuffix(prefix, "/") {
prefix = prefix + "/"
}
// ... rest unchanged