Commit graph

94 commits

Author SHA1 Message Date
David Chang
4397b4390d Prepare next development version. 2020-02-15 13:33:42 -08:00
David Chang
671bfeaf26 Prepare for release 4.0.0-alpha04 2020-02-15 13:31:51 -08:00
Yang
8bc3c76eb1
Start tracking API binary compatibility (#97)
* Configure binary-compatibility-validator plugin.

* Generate current API dumps.

* Update CONTRUBUTON.md with instruction for updating API dumps.
2020-02-15 11:59:42 -05:00
David Chang
536af1f455
Add code coverage (Jacoco) and CodeCov (#100)
* [WIP] Add code coverage

* Get multi-module and merging working

* Add CodeCov

* Update location of report.xml

* Check instead of build depends on Jacoco

* Do not merge coverage

* Ignore tests

* update comment
2020-02-13 17:42:05 -08:00
William Clausen
091d81c3f8 Prepare next development version. 2020-02-13 11:45:07 -08:00
William Clausen
12a2600551 Prepare for release 4.0.0-alpha03 2020-02-13 11:40:22 -08:00
Mike Nakhimovich
7b7f01a439
Rxbindings (#93)
RxJava2 extensions
2020-02-12 20:36:10 -05:00
David Chang
859c11c0c0 Prepare next development version. 2020-01-29 07:41:07 -08:00
David Chang
8b20e8823e Prepare for release 4.0.0-alpha02 2020-01-29 07:41:07 -08:00
Yang
613a5c8296 Add support for purging all store entries (#79)
* Fix typos.

* Gradle 6.1, AGP 4.0.0-alpha09, lifecycle 2.2.0.

* Add experimental invalidateAll() support and @ExperimentalStoreAPI annotation.

* Update sample with deleteAll function.

* Update README.md with deleteAll function.

* Add a section to README.md on clearing store entries.

* Rewrite tests without mocking. Move test utils / helpers to a single package.

* Code formatting and cleanups.

* Use StoreResponse.Data instead of DataWithOrigin in ClearAllStoreTest and ClearStoreByKeyTest.

* Simplified samples. Refactor tests.

* Gradle 6.1.1.
2020-01-28 09:02:28 -08:00
ychescale9
7ee32a7468 Clean up build configs (#62)
* Update dependencies, clean up unused dependencies.

* Remove unused checkstyle and pmd rulesets.

* Use `plugins` block.

* Fix compiler warnings.
2020-01-13 12:43:41 -05:00
William Clausen
c227221b23 Increment version for 4.0.0-alpha01 release and prep next development version (#58)
* Prepare for release 4.0.0-alpha01

* Prepare next development version

* Update build.gradle

Co-Authored-By: Mike Nakhimovich <digitalbuddha@users.noreply.github.com>

Co-authored-by: Mike Nakhimovich <digitalbuddha@users.noreply.github.com>
2020-01-10 16:46:02 -05:00
Mike Nakhimovich
267f803db0
fix dokka, update comments, integrate persister (#56)
* fix dokka, update comments, integrate persister
2020-01-07 14:08:53 -05:00
ychescale9
ba3bf9fd2e Misc improvements and cleanups (#47)
* Add kotlin plugin to cache module

* Remove custom accessors in StoreDefaults as default values are effectively constant.

* Update JUnit to 4.13 RC2 to enable  asserting specific error message on expected exception.

* Remove custom accessors in MemoryPolicy as all values are calculated from constants.

* Remove checkstyle and pmd as the codebase will be 100% Kotlin.

* Fix IDE warning in build.gradle by removing static imports.

* Remove unused guava dependencies.

* Improve StoreDefaults docs.
2019-12-26 13:21:52 -05:00
Pavlos-Petros Tournaris
8c435edca0 Simplify few things in root build.gradle (#38) 2019-12-17 14:39:08 -08:00
ychescale9
1810355341 Update dependencies and clean up unused ones (#16)
* Update dependencies and clean up unused ones.

* Update okio to 2.4.1 and migrate deprecated APIs to extension functions.

* Update platform and build-tools in travis config.
2019-12-10 20:12:51 -05:00
ychescale9
8ddbe3c76f Add ktlint and fix all issues. (#11) 2019-12-10 10:51:14 -05:00
David Chang
dce8b865c1 Update maven coordinates for Store 4 2019-12-09 11:39:20 -08:00
Yigit Boyar
6d97c399fa move multicast to its own module (#9)
Fixes #8
2019-12-08 19:12:11 +01:00
Mike Nakhimovich
4fa9c252b6
rename package from nytimes to dropbox (#63)
* rename package from nytimes to dropbox

* Update build.gradle

Co-Authored-By: David Chang <changd@gmail.com>
2019-12-05 19:52:47 +01:00
Yigit Boyar
5816adabe5 Cleanup (#62)
* add dokka for store module

move key parser to tests

* remove parser exception

* move RealStore and SourceOfTruth to internal

* move cache type to internal

* move Clearable to tests

* move fetcher to tests

* move multiplexer to internal

* move map indexed to internal
2019-12-04 09:40:29 +01:00
Yigit Boyar
d5e7f196d1 faster builds (#58)
enable build cache
enable configure on demand
remove snapshot repo from repositories as we never use it
but it is very slow
2019-11-23 21:34:10 -05:00
Yigit Boyar
52aefe0094 random code cleanups (#57)
* random cleanup.

Fixed a bunch of warnings.
Moved SimplePersisterAsFlowable into tests as it is not used anymore but
FlowTest uses it.
Moved MemoryPolicyBuilder test to kotlin to make DEFAULT_POLICY a const

* massive file migration
Rename pipeline tests into impl tests
2019-11-23 14:00:34 -05:00
Yigit Boyar
c223e44d8d
Close channels w/ a suspend function. (#56)
This PR fixes a bug in StoreRealActor where we could call onClose
while actor is processing some messages. Now instead we send a token
to close and inside the message handler we close the channel so that
no new messages can arrive after close meanwhile messages that arrived
before that close is handled properly.

Also set version to 4.0.0 and cleaned up some code.

Fixes #55
2019-11-20 07:11:31 -08:00
Yigit Boyar
42c37d7656 Spotless integration (#51)
* apply spotless for unified code style

* configure circleci to run spotless
2019-11-09 17:02:01 -05:00
Yigit Boyar
ba22d0c66c Internal Store 3rd attempt (#35)
* WIP publish test

* add actor based implementation, seems the most promising

* add notes into channel manager as well

* use unlimited channel on the receiver to avoid launching to send

* carry over remaining subscribers into a new flow

* dispatch errors from upstream to all downstreams

* carry over all leftovers at once to avoid starting producer before all is added to the list

* handle swapping channel managers in the consumer

This CL fixes an issue where we wouldn't unsubscribe from the right channel if
the downstream is moved between channel managers due to not receiving any event
after registering.

I've also cleaned up dispatchError to close the channel with error instead of
passing it down as if it is value and throwing again

* allow live buffering

this adds a live buffering functionality to actor publish where
it only buffers if the upstream is still running

* remove logging

* move into src

* code cleanup, more comments

* first shot at new internal store, tests pass, code ugly

* tmp builder for real internal store, starting pipeline tests

* more wip in fixing pipeline store tests, a lot to cleanup

* all tests pass

* code cleanup

* move multiplexer inside store4

* lots of cleanup of unnecessary code

* release barriers that are not used

* don't use pipeline persister.
also fixed a barrier cleanup code in source of truth with barrier

* revert simple persister as flowable change
cleanup for clearstorememorytest

* close multiplexers in fetcher controller when not used

* code style fixes
2019-11-03 10:41:32 -05:00
Yigit Boyar
915bd7d4d7 StoreResponse (#33)
* Introduce StoreResponse

This CL changes Pipeline API to dispatch StoreResponse instead of Output.
It will allow us to add more metadata into it and also handle things like
source attribution and/or loading state.

This CL only makes the tests pass, does not do anything for actually dispatching
loading state

* first shot at adding a loading state

This CL adds proper StoreResponse to the built in pipelines such
that they can merge information between network and disk.

It needs some cleanup and PipelinePersister's merging logic is
fairly complicated but i couldn't yet find a simpler way to achieve it

* Add more tests to pipeline

Also fixed a bug in cached where it would emit cached value as
Loading even if no refresh is requested

* fix room sample after rebase

* Update the room sample to support refresh

Also some code cleanup in PipelinePersister

* code cleanup

* explain network + disk flow

* Change StoreResponse for plan D

This CL changes store response to act like plan D described here:
https://paper.dropbox.com/doc/Streaming-Data-How-To--AkwrNu0A7\~BikNOP2m20\~R2_AQ-oLBV39GrNimqGDe1vNQMb

Now StoreResponse has 3 types: Data, Error, Loading and each of these have an  field.
Loading and Error does not carry over last data anymore, instead, it is expected downstream
to merge them for UI, if desired.

This change makes Store more verbose but i think it is the right direction to allow
developer to expand on it as desired

* update AGP to 3.6-alpha11

* update pipeline store tests to check finite streams

This CL updates PipelineStoreTest to consume the whole stream
when we expect it to finish rather than limiting the number of
dispatched items

* update RoomActivity to respect new StoreResponse

* add search to room activity

* code cleanup
2019-09-22 11:23:59 -04:00
Yigit Boyar
d27fb96384
update coroutines to flow stable (#31)
This PR updates coroutines to 1.3.0, kotlin to 1.3.50 and agp to 3.6.alpha08.

I've also cleaned all usage of FlowPreview
2019-08-27 18:43:48 -07:00
Mike Nakhimovich
80e834d536
remove clearMemory, upgrade coroutines (#20)
* remove clearMemory, upgrade coroutines

* rebase, pr comments

* fix build

* fix build

* convert more tests to testScope

* few more conversions
2019-08-11 21:27:36 -04:00
Yigit Boyar
dc9b1bd51c
Suspend cache (#8)
This PR adds a cache implementation that has all APIs as suspend functions.
It uses guava's cache under the hood and handles query deduplication in a custom
Entry type that we keep in the cache
2019-07-02 07:25:36 -07:00
DigitalBuddha
b72122a5e5 fix tests 2019-06-30 12:38:46 -04:00
Fabio Collini
91217c8fa8 RealInternalStore refactoring (#1)
* AGP 3.5.0-beta04

* Stream implementation defined in the interface

* New class StoreWrapper

* Delete StoreBuilder

* Rename plus methods

* Move stalePolicy to Persister

* Simplify code

* Move inflight request management to a new class

* Move cache management to a new class

* Move wrappers to new package

* Delete StoreWrapper class

* New test

* Restored old versions

* Restored old versions

* Restored old versions

* Restored old versions

* Restored old versions

* Restored old versions

* Add runCatching to ignore exceptions on persisters

* Backward compatible RealStoreBuilder implementation

* Fix tests
2019-06-29 19:49:47 -04:00
fabioCollini
fc77dd153c Kotlin 1.3.31 2019-05-21 21:32:27 +02:00
fabioCollini
f3f330fa49 Android Gradle Plugin 3.5.0-beta02 and gradle 5.4.1 2019-05-21 20:25:46 +02:00
Brian Plummer
cba0bbd11b update gradle plugin and wrapper for AS 3.5 beta1, temp fix for null input to ParserException 2019-05-17 17:53:56 -04:00
fabioCollini
e2c0460964 Replaced Channel with BroadcastChannel 2019-02-20 23:23:35 -05:00
Mike Nakhimovich
e024b64e11 WIP 2019-02-12 11:40:39 -05:00
fabioCollini
1b9e79a565 Fix some tests 2019-02-11 15:15:08 -05:00
DigitalBuddha
774e9d9c4b Merge remote-tracking branch 'origin/feature/kotlin_conversion' into feature/coroutines
# Conflicts:
#	app/build.gradle
#	app/src/main/java/com/nytimes/android/sample/SampleApp.kt
#	app/src/main/java/com/nytimes/android/sample/activity/PersistingStoreActivity.java
#	app/src/main/java/com/nytimes/android/sample/activity/StoreActivity.java
#	build.gradle
#	buildsystem/dependencies.gradle
#	filesystem/src/test/java/com/nytimes/android/external/fs3/FilePersisterTest.java
#	filesystem/src/test/java/com/nytimes/android/external/fs3/FileSystemRecordPersisterTest.java
#	filesystem/src/test/java/com/nytimes/android/external/fs3/RecordPersisterTest.java
#	filesystem/src/test/java/com/nytimes/android/external/fs3/SourcePersisterTest.java
#	middleware/src/main/java/com/nytimes/android/external/store3/middleware/GsonParserFactory.kt
#	middleware/src/main/java/com/nytimes/android/external/store3/middleware/GsonReaderParser.kt
#	middleware/src/main/java/com/nytimes/android/external/store3/middleware/GsonSourceParser.kt
#	middleware/src/main/java/com/nytimes/android/external/store3/middleware/GsonStringParser.kt
#	middleware/src/test/java/com/nytimes/android/external/store3/GenericParserStoreTest.java
#	middleware/src/test/java/com/nytimes/android/external/store3/GsonParserFactoryTest.java
#	middleware/src/test/java/com/nytimes/android/external/store3/GsonSourceListParserTest.java
#	store/build.gradle
2019-02-10 19:29:48 -05:00
DigitalBuddha
2d3596e4bb fixing tests 2019-02-10 19:23:00 -05:00
ychescale9
59f9c68342 Update SDK, build tools, gradle, AGP, Kotlin, and library dependencies. (#371)
* Update SDK, build tools, gradle, AGP, Kotlin, and library dependencies.

* Update travis config with new SDK version.
2019-01-07 15:05:05 +01:00
Brian Plummer
9b3cc88b3f
last part of filesystem tests conversion (#356)
* rest of filesystem tests

* remove el
2018-07-18 23:18:46 +02:00
Brian Plummer
31ec45caa6 middleware conversion to kotlin (#351)
* convert middleware to kotlin, start with tests

* convert source

* pr feedback, change mocks to lateinit

* change compile to implementation

* change rest of compile to use implementation, and append version of kotlin

* remove obsolete constructor checks

* pr feedback convert one liners to assignments
2018-07-11 14:02:33 -04:00
Brian Plummer
df71de8bbd
convert moshi middleware to kotlin (#349)
* start conversion of middleware to moshi, tests first

* convert data model of tests

* convert source to kotlin

* pr feedback, change mocks to lateinit
2018-07-10 15:13:44 +02:00
Brian Plummer
fae3ccc828
Convert sample to kotlin (#347)
* start of sample app conversion to kotlin

* go with moshi kotlin codegen instead of immutables

* pr feedback, use lateinit and make non-null

* pr feedback, unwind method
2018-07-10 14:07:50 +02:00
Ramona Harrison
b62cd730ad Prepare next development version. 2018-06-07 14:13:38 -04:00
Ramona Harrison
6ea6f30a6a Prepare for release 3.1.0. 2018-06-07 13:43:16 -04:00
Mike Nakhimovich
6ac40cd371 StoreRoom (#338)
* roomStore

* kt the app class

* refactor

* fix compilation

* Update .travis.yml

* migrate relevant tests to RoomStore, mark new Room API with @Experimental

* pr feedback

* bump minor rev up

* cleanup store

* create factory, clean up example

* pr comments
2018-05-30 18:56:08 +02:00
Tournaris Pavlos-Petros
d92307f0ff Bump AGP to 3.1.2 stable 2018-05-13 22:35:44 +03:00
pavlospt
7d74ccabf0
Update AGP to 3.1.0 stable 2018-03-29 16:55:33 +03:00