From 2343cb633118aaeaea26d0c7876299e2087a3baf Mon Sep 17 00:00:00 2001 From: "A.Unger" Date: Fri, 23 Oct 2020 10:38:23 +0200 Subject: [PATCH 1/2] interpret lower bounds correctly for the cs3 index --- accounts/pkg/indexer/index/cs3/autoincrement.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/accounts/pkg/indexer/index/cs3/autoincrement.go b/accounts/pkg/indexer/index/cs3/autoincrement.go index d65f45559db..010499a4f8a 100644 --- a/accounts/pkg/indexer/index/cs3/autoincrement.go +++ b/accounts/pkg/indexer/index/cs3/autoincrement.go @@ -41,6 +41,7 @@ type Autoincrement struct { dataProvider dataProviderClient // Used to create and download data via http, bypassing reva upload protocol cs3conf *Config + bound *option.Bound } func init() { @@ -58,6 +59,7 @@ func NewAutoincrementIndex(o ...option.Option) index.Index { indexBy: opts.IndexBy, typeName: opts.TypeName, filesDir: opts.FilesDir, + bound: opts.Bound, indexBaseDir: path.Join(opts.DataDir, "index.cs3"), indexRootDir: path.Join(path.Join(opts.DataDir, "index.cs3"), strings.Join([]string{"autoincrement", opts.TypeName, opts.IndexBy}, ".")), cs3conf: &Config{ @@ -356,5 +358,10 @@ func (idx *Autoincrement) next() (int, error) { if err != nil { return -1, err } + + if int64(latest) < idx.bound.Lower { + return int(idx.bound.Lower), nil + } + return latest + 1, nil } From a8429bde82d87fdf6d651d73f9a181d5e312fd39 Mon Sep 17 00:00:00 2001 From: "A.Unger" Date: Fri, 23 Oct 2020 10:45:02 +0200 Subject: [PATCH 2/2] add changelog --- changelog/unreleased/cs3-index-lowerbound.md | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 changelog/unreleased/cs3-index-lowerbound.md diff --git a/changelog/unreleased/cs3-index-lowerbound.md b/changelog/unreleased/cs3-index-lowerbound.md new file mode 100644 index 00000000000..8b2e4a7aa35 --- /dev/null +++ b/changelog/unreleased/cs3-index-lowerbound.md @@ -0,0 +1,7 @@ +Bugfix: Lower Bound was not working for the cs3 api index implementation + +Tags: accounts + +Lower bound working on the cs3 index implementation + +https://github.com/owncloud/ocis/pull/741