Skip to content

Commit ea6686e

Browse files
authored
v9.1.4: fixed comparison bug in removeTilesOlderThan (#173)
1 parent 55e9585 commit ea6686e

File tree

6 files changed

+17
-5
lines changed

6 files changed

+17
-5
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ Many thanks to my sponsors, no matter how much or how little they donated. Spons
1818

1919
# Changelog
2020

21+
## [9.1.4] - 2024/12/05
22+
23+
* Fixed bug in `removeTilesOlderThan` where actually tiles newer than the specified expiry were being removed ([#172](https://github.com/JaffaKetchup/flutter_map_tile_caching/issues/172))
24+
2125
## [9.1.3] - 2024/08/19
2226

2327
* Fixed bug where any operation that attempted to delete tiles fatally crashed on some iOS devices

example/pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ description: The example application for 'flutter_map_tile_caching', showcasing
33
it's functionality and use-cases.
44
publish_to: "none"
55

6-
version: 9.1.3
6+
version: 9.1.4
77

88
environment:
99
sdk: ">=3.3.0 <4.0.0"

lib/src/backend/impls/objectbox/backend/internal_workers/standard/worker.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,7 @@ Future<void> _worker(
543543
.build();
544544
final tilesQuery = (root.box<ObjectBoxTile>().query(
545545
ObjectBoxTile_.lastModified
546-
.greaterThan(expiry.millisecondsSinceEpoch),
546+
.lessThan(expiry.millisecondsSinceEpoch),
547547
)..linkMany(
548548
ObjectBoxTile_.stores,
549549
ObjectBoxStore_.name.equals(storeName),

lib/src/backend/interfaces/backend/internal.dart

+9-1
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,15 @@ abstract interface class FMTCBackendInternal
197197
});
198198

199199
/// {@template fmtc.backend.removeTilesOlderThan}
200-
/// Remove tiles that were last modified after expiry from the specified store
200+
/// Remove tiles that were last modified prior to the expiry timestamp from
201+
/// the specified store
202+
///
203+
/// For example, to remove tiles last modified over 14 days ago, calculate
204+
/// [expiry] with:
205+
///
206+
/// ```dart
207+
/// expiry: DateTime.timestamp().subtract(const Duration(days: 14))
208+
/// ```
201209
///
202210
/// Returns the number of tiles that were actually deleted (they were
203211
/// orphaned). See [deleteTile] for more information about orphan tiles.

pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: flutter_map_tile_caching
22
description: Plugin for 'flutter_map' providing advanced caching functionality,
33
with ability to download map regions for offline use.
4-
version: 9.1.3
4+
version: 9.1.4
55

66
repository: https://github.com/JaffaKetchup/flutter_map_tile_caching
77
issue_tracker: https://github.com/JaffaKetchup/flutter_map_tile_caching/issues

windowsApplicationInstallerSetup.iss

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
; Script generated by the Inno Setup Script Wizard
22

33
#define MyAppName "FMTC Demo"
4-
#define MyAppVersion "for 9.1.3"
4+
#define MyAppVersion "for 9.1.4"
55
#define MyAppPublisher "JaffaKetchup Development"
66
#define MyAppURL "https://github.com/JaffaKetchup/flutter_map_tile_caching"
77
#define MyAppSupportURL "https://github.com/JaffaKetchup/flutter_map_tile_caching/issues"

0 commit comments

Comments
 (0)