Skip to content

Commit 19e8500

Browse files
Change default version for CatalogVersionRequest (#1298)
Update default version to exclude valid version from a default request. Update condition as well to control allowed version to be stored as the latest one Relates-To: OAM-1387 Signed-off-by: Andrey Kashcheev <[email protected]>
1 parent ad32022 commit 19e8500

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

olp-cpp-sdk-dataservice-read/include/olp/dataservice/read/CatalogClient.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2019-2021 HERE Europe B.V.
2+
* Copyright (C) 2019-2022 HERE Europe B.V.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -151,7 +151,7 @@ class DATASERVICE_READ_API CatalogClient final {
151151
* @param request The `CatalogVersionRequest` instance that contains
152152
* a complete set of request parameters.
153153
*
154-
* @return CancellableFuture` that contains the `CatalogVersionResponse`
154+
* @return `CancellableFuture` that contains the `CatalogVersionResponse`
155155
* instance with the catalog configuration or an error. You can also
156156
* use `CancellableFuture` to cancel this request.
157157
*/

olp-cpp-sdk-dataservice-read/include/olp/dataservice/read/CatalogVersionRequest.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2019-2021 HERE Europe B.V.
2+
* Copyright (C) 2019-2022 HERE Europe B.V.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -151,7 +151,7 @@ class DATASERVICE_READ_API CatalogVersionRequest final {
151151
}
152152

153153
private:
154-
int64_t start_version_{0};
154+
int64_t start_version_{-1};
155155
boost::optional<std::string> billing_tag_;
156156
FetchOptions fetch_option_{OnlineIfNotFound};
157157
};

olp-cpp-sdk-dataservice-read/src/repositories/CatalogRepository.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2019-2021 HERE Europe B.V.
2+
* Copyright (C) 2019-2022 HERE Europe B.V.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -145,7 +145,7 @@ CatalogVersionResponse CatalogRepository::GetLatestVersion(
145145
constexpr auto kDefaultStartVersion = 0;
146146

147147
auto user_set_version = request.GetStartVersion();
148-
if (user_set_version != kDefaultStartVersion) {
148+
if (user_set_version >= kDefaultStartVersion) {
149149
if (!cached_version || user_set_version > cached_version->GetVersion()) {
150150
model::VersionResponse new_response;
151151
new_response.SetVersion(user_set_version);

0 commit comments

Comments
 (0)