chore: bump reva for upload coordinator fixes

This commit is contained in:
Firas Frikha committed 2026-08-03 11:10:54 +02:00
1 parent 620a94abf9
commit 0968ff11e1
6 files changed
+44 -23

No files matched your search

+1 -1
View File
@@ -66,7 +66,7 @@ require (
github.com/open-policy-agent/opa v1.18.2
github.com/orcaman/concurrent-map v1.0.0
github.com/owncloud/libre-graph-api-go v1.0.5-0.20260216101009-eeac018af245
github.com/owncloud/reva/v2 v2.0.0-20260731133734-ff71861a97b3
github.com/owncloud/reva/v2 v2.0.0-20260803085958-0f1033fbf237
github.com/pkg/errors v0.9.1
github.com/pkg/xattr v0.4.12
github.com/prometheus/client_golang v1.24.1
+2
View File
@@ -741,6 +741,8 @@ github.com/owncloud/libre-graph-api-go v1.0.5-0.20260216101009-eeac018af245 h1:J
github.com/owncloud/libre-graph-api-go v1.0.5-0.20260216101009-eeac018af245/go.mod h1:z61VMGAJRtR1nbgXWiNoCkxUXP1B3Je9rMuJbnGd+Og=
github.com/owncloud/reva/v2 v2.0.0-20260731133734-ff71861a97b3 h1:cx509Tm9QnYvf5OCQs4jwMZgTVMMUjFiVcKmGzmP/r0=
github.com/owncloud/reva/v2 v2.0.0-20260731133734-ff71861a97b3/go.mod h1:bW0gOn58J6J9sWQDdWP5oQhCjTKoEGAxT4tWE6Ztziw=
github.com/owncloud/reva/v2 v2.0.0-20260803085958-0f1033fbf237 h1:6EInmwSbEg91zdXQ65/uz21gwC3ZZ9VxlBqpRgT/w3U=
github.com/owncloud/reva/v2 v2.0.0-20260803085958-0f1033fbf237/go.mod h1:bW0gOn58J6J9sWQDdWP5oQhCjTKoEGAxT4tWE6Ztziw=
github.com/oxtoacart/bpool v0.0.0-20190530202638-03653db5a59c h1:rp5dCmg/yLR3mgFuSOe4oEnDDmGLROTvMragMUXpTQw=
github.com/oxtoacart/bpool v0.0.0-20190530202638-03653db5a59c/go.mod h1:X07ZCGwUbLaax7L0S3Tw4hpejzu63ZrrQiUe6W0hcy0=
github.com/pablodz/inotifywaitgo v0.0.12 h1:DVJJTFMDlSAdO46yisPF2vzozs/r+4k6ih8MVghq78M=
@@ -509,15 +509,29 @@ func (fs *Decomposedfs) PrepareUpload(ctx context.Context, ref *provider.Referen
}
}()
var (
old *node.Node
overwrite bool
oldBlobsize int64
)
if info.NodeExisted {
old, err := node.ReadNode(ctx, fs.lu, n.SpaceID, n.ID, false, nil, false)
old, err = node.ReadNode(ctx, fs.lu, n.SpaceID, n.ID, false, nil, false)
if err != nil {
return nil, errors.Wrap(err, "PrepareUpload: failed to read existing node")
}
if _, err := node.CheckQuota(ctx, n.SpaceRoot, old.BlobID != "", uint64(old.Blobsize), uint64(info.Size)); err != nil {
return nil, err
}
overwrite = old.BlobID != ""
oldBlobsize = old.Blobsize
}
// Unconditional: the coordinator's up-front check fails open when the executant
// cannot read the quota (an Uploader on someone else's share), and defers to
// this one. Checking only overwrites would let every new file past both gates,
// and would skip the disk-space guard CheckQuota also performs.
if _, err := node.CheckQuota(ctx, n.SpaceRoot, overwrite, uint64(oldBlobsize), uint64(info.Size)); err != nil {
return nil, err
}
if info.NodeExisted {
oldMtime, err = old.GetMTime(ctx)
if err != nil {
return nil, err
+15 -15
View File
@@ -501,15 +501,11 @@ func (c *coordinator) publishBytesReceived(ctx context.Context, session Session)
return err
}
executant := session.Executant()
return events.Publish(ctx, c.pub, events.BytesReceived{
UploadID: session.ID(),
URL: url,
SpaceOwner: session.SpaceOwner(),
ExecutingUser: &user.User{
Id: &executant,
},
UploadID: session.ID(),
URL: url,
SpaceOwner: session.SpaceOwner(),
ExecutingUser: session.ExecutantUser(),
ResourceID: &provider.ResourceId{
StorageId: session.ProviderID(),
SpaceId: session.SpaceID(),
@@ -667,6 +663,13 @@ func (c *coordinator) uploadedResourceInfo(ctx context.Context, session Session)
ref := session.Reference()
ri, err := c.fs.GetMD(ctx, &ref, nil, nil)
if err == nil {
// Drivers do not know their own mount id; the storageprovider stamps it on
// the way out (addMissingStorageProviderID). This path answers from the
// dataprovider, which does not, so an unstamped id would reach the client
// as a two-part storageid-less string that later lookups cannot resolve.
if ri.GetId().GetStorageId() == "" {
ri.Id.StorageId = session.ProviderID()
}
return ri
}
appctx.GetLogger(ctx).Debug().Err(err).Str("uploadid", session.ID()).Msg("could not stat uploaded resource")
@@ -716,14 +719,11 @@ func (c *coordinator) publishUploadReady(ctx context.Context, session Session, r
if c.pub == nil {
return
}
executant := session.Executant()
if err := events.Publish(ctx, c.pub, events.UploadReady{
UploadID: session.ID(),
Filename: session.Filename(),
SpaceOwner: session.SpaceOwner(),
ExecutingUser: &user.User{
Id: &executant,
},
UploadID: session.ID(),
Filename: session.Filename(),
SpaceOwner: session.SpaceOwner(),
ExecutingUser: session.ExecutantUser(),
FileRef: c.uploadRef(session),
ResourceID: ri.GetId(),
Timestamp: utils.TSNow(),
+7 -2
View File
@@ -59,6 +59,7 @@ type Session interface {
// Internal coordinator plumbing.
Chunk() string
BinPath() string
ExecutantUser() *userpb.User
ProviderID() string
SpaceID() string
NodeID() string
@@ -377,7 +378,7 @@ func (s *FileSession) Context(ctx context.Context) context.Context {
sub := s.store.log.With().Int("pid", os.Getpid()).Logger()
ctx = appctx.WithLogger(ctx, &sub)
ctx = ctxpkg.ContextSetLockID(ctx, s.info.MetaData["lockid"])
ctx = ctxpkg.ContextSetUser(ctx, s.executantUser())
ctx = ctxpkg.ContextSetUser(ctx, s.ExecutantUser())
return ctxpkg.ContextSetInitiator(ctx, s.info.MetaData["initiatorid"])
}
@@ -423,7 +424,11 @@ func (s *FileSession) infoPath() string {
return fileSessionPath(s.store.root, s.info.ID)
}
func (s *FileSession) executantUser() *userpb.User {
// ExecutantUser returns the full identity of the user who initiated the upload.
// Upload events must carry it rather than the bare id from Executant(): consumers
// read the display name straight off the event and do not look it up, so an
// id-only user reaches the activity feed with a blank name.
func (s *FileSession) ExecutantUser() *userpb.User {
var o *typespb.Opaque
_ = json.Unmarshal([]byte(s.info.Storage["UserOpaque"]), &o)
var groups []string
+1 -1
View File
@@ -1321,7 +1321,7 @@ github.com/orcaman/concurrent-map
# github.com/owncloud/libre-graph-api-go v1.0.5-0.20260216101009-eeac018af245
## explicit; go 1.18
github.com/owncloud/libre-graph-api-go
# github.com/owncloud/reva/v2 v2.0.0-20260731133734-ff71861a97b3
# github.com/owncloud/reva/v2 v2.0.0-20260803085958-0f1033fbf237
## explicit; go 1.25.11
github.com/owncloud/reva/v2/cmd/revad/internal/grace
github.com/owncloud/reva/v2/cmd/revad/runtime