From 2affdec7dc8cecac727ef9971af8cdc693992bc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Wed, 24 Jan 2024 11:43:55 +0100 Subject: [PATCH] upload session specific processing flag MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jörn Friedrich Dreyer --- .../uploadsession-specific-processing-flag.md | 5 +++++ pkg/storage/utils/decomposedfs/upload/session.go | 8 ++------ 2 files changed, 7 insertions(+), 6 deletions(-) create mode 100644 changelog/2.0.0_2022-03-03/uploadsession-specific-processing-flag.md diff --git a/changelog/2.0.0_2022-03-03/uploadsession-specific-processing-flag.md b/changelog/2.0.0_2022-03-03/uploadsession-specific-processing-flag.md new file mode 100644 index 00000000000..def07a36e7a --- /dev/null +++ b/changelog/2.0.0_2022-03-03/uploadsession-specific-processing-flag.md @@ -0,0 +1,5 @@ +Bugfix: upload session specific processing flag + +To make every upload session have a dedicated processing status, upload sessions are now treated as in processing when all bytes have been received instead of checking the node metadata. + +https://github.com/cs3org/reva/pull/4475 diff --git a/pkg/storage/utils/decomposedfs/upload/session.go b/pkg/storage/utils/decomposedfs/upload/session.go index 4107ea5e2dd..c6fed249e7b 100644 --- a/pkg/storage/utils/decomposedfs/upload/session.go +++ b/pkg/storage/utils/decomposedfs/upload/session.go @@ -295,13 +295,9 @@ func (s *OcisSession) MTime() time.Time { return t } -// IsProcessing returns true if the node has entered postprocessing state +// IsProcessing returns true if all bytes have been received. The node then has entered postprocessing state. func (s *OcisSession) IsProcessing() bool { - n, err := s.Node(context.Background()) - if err != nil { - return false - } - return n.IsProcessing(context.Background()) + return s.info.Size == s.info.Offset } // binPath returns the path to the file storing the binary data.