Bump reva to pull in the latest changes

This commit is contained in:
André Duffeck
2025-05-14 09:18:43 +02:00
parent 400fc0b4c2
commit 77aa702d23
9 changed files with 38 additions and 11 deletions

View File

@@ -31,6 +31,7 @@ type ContainerCreated struct {
SpaceOwner *user.UserId
Executant *user.UserId
Ref *provider.Reference
ParentID *provider.ResourceId
Owner *user.UserId
Timestamp *types.Timestamp
ImpersonatingUser *user.User
@@ -65,6 +66,7 @@ type FileTouched struct {
SpaceOwner *user.UserId
Executant *user.UserId
Ref *provider.Reference
ParentID *provider.ResourceId
Timestamp *types.Timestamp
ImpersonatingUser *user.User
}

View File

@@ -184,6 +184,7 @@ type UploadReady struct {
ExecutingUser *user.User
ImpersonatingUser *user.User
FileRef *provider.Reference
ParentID *provider.ResourceId
Timestamp *types.Timestamp
Failed bool
IsVersion bool

View File

@@ -521,11 +521,20 @@ func (t *Tree) assimilate(item scanItem) error {
// assimilate new file
newId := uuid.New().String()
fi, _, err := t.updateFile(item.Path, newId, spaceID, nil)
fi, attrs, err := t.updateFile(item.Path, newId, spaceID, nil)
if err != nil {
return err
}
var parentId *provider.ResourceId
if len(attrs[prefixes.ParentidAttr]) > 0 {
parentId = &provider.ResourceId{
StorageId: t.options.MountID,
SpaceId: spaceID,
OpaqueId: string(attrs[prefixes.ParentidAttr]),
}
}
ref := &provider.Reference{
ResourceId: &provider.ResourceId{
StorageId: t.options.MountID,
@@ -536,17 +545,20 @@ func (t *Tree) assimilate(item scanItem) error {
if fi.IsDir() {
t.PublishEvent(events.ContainerCreated{
Ref: ref,
ParentID: parentId,
Timestamp: utils.TSNow(),
})
} else {
if fi.Size() == 0 {
t.PublishEvent(events.FileTouched{
Ref: ref,
ParentID: parentId,
Timestamp: utils.TSNow(),
})
} else {
t.PublishEvent(events.UploadReady{
FileRef: ref,
ParentID: parentId,
Timestamp: utils.TSNow(),
})
}

View File

@@ -453,7 +453,8 @@ func (t *Tree) ListFolder(ctx context.Context, n *node.Node) ([]*node.Node, erro
child, err := node.ReadNode(ctx, t.lookup, n.SpaceID, nodeID, false, n.SpaceRoot, true)
if err != nil {
return err
t.log.Error().Err(err).Str("path", path).Msg("failed to read node")
continue
}
// prevent listing denied resources

View File

@@ -343,6 +343,7 @@ func (fs *Decomposedfs) Postprocessing(ch <-chan events.Event) {
}
now := time.Now()
var parentId *provider.ResourceId
if failed {
// if no other upload session is in progress (processing id != session id) or has finished (processing id == "")
latestSession, err := n.ProcessingID(ctx)
@@ -356,6 +357,11 @@ func (fs *Decomposedfs) Postprocessing(ch <-chan events.Event) {
}
}
} else if p := getParent(); p != nil {
parentId = &provider.ResourceId{
StorageId: session.ProviderID(),
SpaceId: session.SpaceID(),
OpaqueId: p.ID,
}
// update parent tmtime to propagate etag change after successful postprocessing
_ = p.SetTMTime(ctx, &now)
if err := fs.tp.Propagate(ctx, p, 0); err != nil {
@@ -389,6 +395,7 @@ func (fs *Decomposedfs) Postprocessing(ch <-chan events.Event) {
},
Path: utils.MakeRelativePath(filepath.Join(session.Dir(), session.Filename())),
},
ParentID: parentId,
Timestamp: utils.TimeToTS(now),
SpaceOwner: n.SpaceOwnerOrManager(ctx),
IsVersion: isVersion,

View File

@@ -129,7 +129,11 @@ func (fs *Decomposedfs) CreateStorageSpace(ctx context.Context, req *provider.Cr
}
// 770 permissions for the space
if err := os.MkdirAll(rootPath, 0770); err != nil {
if err := os.Mkdir(rootPath, 0770); err != nil {
if os.IsExist(err) {
// Someone has created the space in the meantime. Abort.
return nil, errtypes.AlreadyExists(spaceID)
}
return nil, errors.Wrap(err, fmt.Sprintf("Decomposedfs: error creating space %s", rootPath))
}