Skip to content

Commit

Permalink
fix: Fixed a bug that did not include its own GeoHash.
Browse files Browse the repository at this point in the history
  • Loading branch information
mathrunet committed Aug 17, 2023
1 parent 17c6a0d commit 6e48ffe
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 27 deletions.
40 changes: 20 additions & 20 deletions packages/masamune/example/pubspec.lock
Expand Up @@ -404,7 +404,7 @@ packages:
path: "../../katana_form"
relative: true
source: path
version: "2.6.0"
version: "2.6.1"
katana_functions:
dependency: "direct overridden"
description:
Expand Down Expand Up @@ -439,7 +439,7 @@ packages:
path: "../../katana_listenables_builder"
relative: true
source: path
version: "2.0.15"
version: "2.0.16"
katana_localization:
dependency: "direct overridden"
description:
Expand All @@ -460,7 +460,7 @@ packages:
path: "../../katana_localization_builder"
relative: true
source: path
version: "2.0.17"
version: "2.0.18"
katana_logger:
dependency: "direct overridden"
description:
Expand All @@ -474,14 +474,14 @@ packages:
path: "../../katana_model"
relative: true
source: path
version: "2.11.3"
version: "2.11.5"
katana_model_local:
dependency: "direct overridden"
description:
path: "../../katana_model_local"
relative: true
source: path
version: "2.5.3"
version: "2.5.5"
katana_prefs:
dependency: "direct overridden"
description:
Expand All @@ -502,28 +502,28 @@ packages:
path: "../../katana_prefs_builder"
relative: true
source: path
version: "2.0.15"
version: "2.0.16"
katana_router:
dependency: "direct overridden"
description:
path: "../../katana_router"
relative: true
source: path
version: "2.0.24"
version: "2.0.27"
katana_router_annotation:
dependency: "direct overridden"
description:
path: "../../katana_router_annotation"
relative: true
source: path
version: "2.0.15"
version: "2.0.16"
katana_router_builder:
dependency: "direct overridden"
description:
path: "../../katana_router_builder"
relative: true
source: path
version: "2.0.21"
version: "2.0.23"
katana_scoped:
dependency: "direct overridden"
description:
Expand Down Expand Up @@ -565,7 +565,7 @@ packages:
path: "../../katana_theme_builder"
relative: true
source: path
version: "2.0.15"
version: "2.0.16"
katana_ui:
dependency: "direct overridden"
description:
Expand Down Expand Up @@ -595,7 +595,7 @@ packages:
path: ".."
relative: true
source: path
version: "2.4.7"
version: "2.4.12"
masamune_annotation:
dependency: "direct overridden"
description:
Expand All @@ -609,7 +609,7 @@ packages:
path: "../../masamune_builder"
relative: true
source: path
version: "2.7.5"
version: "2.7.8"
matcher:
dependency: transitive
description:
Expand Down Expand Up @@ -842,6 +842,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.0.4"
shimmer:
dependency: transitive
description:
name: shimmer
sha256: "5f88c883a22e9f9f299e5ba0e4f7e6054857224976a5d9f839d4ebdc94a14ac9"
url: "https://pub.dev"
source: hosted
version: "3.0.0"
sky_engine:
dependency: transitive
description: flutter
Expand Down Expand Up @@ -959,14 +967,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.0.0+1"
url_strategy:
dependency: transitive
description:
name: url_strategy
sha256: "42b68b42a9864c4d710401add17ad06e28f1c1d5500c93b98c431f6b0ea4ab87"
url: "https://pub.dev"
source: hosted
version: "0.2.0"
uuid:
dependency: transitive
description:
Expand Down
7 changes: 6 additions & 1 deletion packages/masamune/lib/model/model_query_selector.dart
Expand Up @@ -499,6 +499,7 @@ class ModelGeoValueModelQuerySelector<TQuery extends ModelQueryBase>

final neighbors = [
if (sourceNeighbors != null) ...sourceNeighbors,
value.value.geoHash,
...value.value.neighbors,
].distinct().sortTo((a, b) => a.compareTo(b));
return _toQuery(
Expand All @@ -522,6 +523,7 @@ class ModelGeoValueModelQuerySelector<TQuery extends ModelQueryBase>
)
?.value as List<String>?;

sourceNeighbors?.remove(value.value.geoHash);
for (final hash in value.value.neighbors) {
sourceNeighbors?.remove(hash);
}
Expand All @@ -543,7 +545,10 @@ class ModelGeoValueModelQuerySelector<TQuery extends ModelQueryBase>
return _toQuery(
_modelQuery.geo(
key,
value.value.neighbors,
[
value.value.geoHash,
...value.value.neighbors,
],
),
);
}
Expand Down
28 changes: 22 additions & 6 deletions packages/masamune/pubspec.lock
Expand Up @@ -97,6 +97,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "3.0.3"
csv:
dependency: transitive
description:
name: csv
sha256: "016b31a51a913744a0a1655c74ff13c9379e1200e246a03d96c81c5d9ed297b5"
url: "https://pub.dev"
source: hosted
version: "5.0.2"
encrypt:
dependency: transitive
description:
Expand Down Expand Up @@ -240,14 +248,14 @@ packages:
path: "../katana_auth"
relative: true
source: path
version: "2.0.13"
version: "2.0.14"
katana_form:
dependency: "direct main"
description:
path: "../katana_form"
relative: true
source: path
version: "2.6.0"
version: "2.6.1"
katana_functions:
dependency: "direct main"
description:
Expand Down Expand Up @@ -303,14 +311,14 @@ packages:
path: "../katana_model"
relative: true
source: path
version: "2.11.3"
version: "2.11.7"
katana_model_local:
dependency: "direct main"
description:
path: "../katana_model_local"
relative: true
source: path
version: "2.5.3"
version: "2.6.4"
katana_prefs:
dependency: "direct main"
description:
Expand Down Expand Up @@ -380,7 +388,7 @@ packages:
path: "../katana_ui"
relative: true
source: path
version: "2.3.0"
version: "2.4.1"
lints:
dependency: transitive
description:
Expand All @@ -403,7 +411,7 @@ packages:
path: "../masamune_annotation"
relative: true
source: path
version: "2.2.2"
version: "2.3.3"
matcher:
dependency: transitive
description:
Expand Down Expand Up @@ -652,6 +660,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.0.4"
shimmer:
dependency: transitive
description:
name: shimmer
sha256: "5f88c883a22e9f9f299e5ba0e4f7e6054857224976a5d9f839d4ebdc94a14ac9"
url: "https://pub.dev"
source: hosted
version: "3.0.0"
sky_engine:
dependency: transitive
description: flutter
Expand Down

0 comments on commit 6e48ffe

Please sign in to comment.