From 3494052ab643193b0b923eeba951a06fd0470ace Mon Sep 17 00:00:00 2001 From: Benoit 'BoD' Lubek Date: Wed, 21 Aug 2024 14:52:57 +0200 Subject: [PATCH] Store both received date and expiration date in Record (#27) * Store both received date and expiration date in Record * Add a test for DefaultRecordMerger * Fix compilation in test * Fix tests --- .idea/codeStyles/Project.xml | 67 ++++++++++++++++ .../api/normalized-cache-incubating.api | 18 +++-- .../api/normalized-cache-incubating.klib.api | 19 +++-- .../cache/normalized/ClientCacheExtensions.kt | 2 +- .../normalized/api/ApolloCacheHeaders.kt | 9 ++- .../cache/normalized/api/CacheResolver.kt | 12 +-- .../cache/normalized/api/MemoryCache.kt | 26 ++---- .../cache/normalized/api/NormalizedCache.kt | 4 - .../cache/normalized/api/Record.kt | 40 ++++++++-- .../cache/normalized/api/RecordMerger.kt | 41 +++++----- .../api/internal/BlobRecordSerializer.kt | 5 +- .../normalized/api/internal/Normalizer.kt | 1 - .../normalized/api/internal/RecordWeigher.kt | 1 - .../internal/ApolloCacheInterceptor.kt | 6 +- .../normalized/DefaultRecordMergerTest.kt | 79 +++++++++++++++++++ .../cache/normalized/RecordWeigherTest.kt | 4 +- .../normalized/sql/SqlNormalizedCache.kt | 43 ++++------ .../sql/internal/Blob2RecordDatabase.kt | 15 ++-- .../cache/normalized/sql/TrimTest.kt | 7 +- .../kotlin/ClientSideExpirationTest.kt | 4 +- .../OffsetBasedWithPagePaginationTest.kt | 1 - 21 files changed, 272 insertions(+), 132 deletions(-) create mode 100644 normalized-cache-incubating/src/commonTest/kotlin/com/apollographql/cache/normalized/DefaultRecordMergerTest.kt diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml index aaa4877..d69494f 100644 --- a/.idea/codeStyles/Project.xml +++ b/.idea/codeStyles/Project.xml @@ -7,7 +7,74 @@