Commit graph

638 commits

Author SHA1 Message Date
Eyal Guthmann
42a21b327b Prepare next development version. 2020-04-29 11:15:51 -07:00
Eyal Guthmann
431b98fd5c Prepare for release 4.0.0-alpha06. 2020-04-29 11:15:51 -07:00
Eyal Guthmann
e71a4e9e4a
Support non exception errors from fetcher (#123)
* Support non exception errors from fetcher

* revert parital changes to store builder to reduce noise

* finish off diff

* Allow to create a FetcherResult.Error without a Throwable. Add tests

* Add missing funcion and more tests

* lint

* unflake RxFlowableStoreTest

* try to rename FakeFetcher to FakeRxFetcher to (maybe) solve missing codcov

* move SourceOfTruth out of impl package

* Rename accidental change of RxStoreBuilder.fromMaybe back to formSingle

* Introduce Fetcher from #139

* fix Rx artifact

* delete legacy presistor factory

* fix api file

* move fetcher to be a typealias

* code review comments + clean up documentation

* code review comments

* Update store/src/main/java/com/dropbox/android/external/store4/Fetcher.kt

Co-Authored-By: Yigit Boyar <yboyar@google.com>

* Revert "Update sample app's build.gradle to refer to the externally released version of Store (#159)"

This reverts commit fc8da86f63.

* update releasing.md

Co-authored-by: Yigit Boyar <yboyar@google.com>
2020-04-29 10:31:10 -07:00
Dave Parker
fc8da86f63
Update sample app's build.gradle to refer to the externally released version of Store (#159)
Co-authored-by: Dave Parker <davidp@dropbox.com>
2020-04-23 19:19:52 -04:00
William Clausen
7d16ce3f12
Update RELEASING.md (#158)
Needed to improve documentation about handling PRs for release versions
2020-04-22 14:52:03 -04:00
Dave Parker
8f0625fc70
Contain @ExperimentalStdlibApi within relevant scope. (#154)
* Contain @ExperimentalStdlibApi within relevant scope.

The alpha04 release of Store caused the requirement of the @ExperimentalStdlibApi annotation for client code. I looked into it, and the only thing in Store that required the annotation was the Kotlin ArrayDeque used in the BufferImpl class. That class is private in the ChannelManager.kt file, so I opted that file into the annotation and removed all other occurences of the annotation.

Code compiles, all 208 tests pass.

* update to correct git glitch in /build.gradle

* update to address 'needless blank line' linter

* Prepare for release 4.0.0-alpha05

* Prepare for next development version.

Co-authored-by: Dave Parker <davidp@dropbox.com>
2020-04-19 19:51:50 -04:00
Yang
e6158669d4
Fix a deadlock during cache eviction (#155)
* Fix a deadlock during cache eviction due to duplicate CacheEntries with different accessTime being added to accessOrder HashSet.

* Rename test.
2020-04-19 19:50:12 -04:00
Claus Holst
d7d8a580b0
Move plugin versions to dependencies.gradle to avoid having kotlin version in two places. (#149)
Kotlin 1.3.71
AGP 4.0.0-beta04
Coroutines 1.3.5
Retrofit 2.8.1
OkHttp 4.5.0
Fragment 1.2.4
Room 2.2.5
2020-04-12 09:39:12 -07:00
Said Tahsin Dane
d15a0c9288
Some little Gradle clean-up (#151) 2020-04-11 20:14:22 -07:00
Claus Holst
031d92e5b4
Use AtomicFu to replace Java's AtomicBoolean and ReentrantLock (#147)
* Use AtomicFu instead of AtomicBoolean

* Use AtomicFu for ReentrantLock in KeyedSynchronizer
2020-04-10 08:38:54 -07:00
Said Tahsin Dane
d3a20e7866
Small: Remove Collections.unmodifiableMap (#145)
* Remove unnecessary Collections.unmodifiableMap since we already return a defensive copy. Also write test to verify we returns a copy

* Update cache/src/test/kotlin/com/dropbox/android/external/cache4/DefaultCacheTest.kt

Co-authored-by: Mike Nakhimovich <digitalbuddha@users.noreply.github.com>
2020-04-07 13:08:18 -04:00
Said Tahsin Dane
b9f42860ed
Remove unneeded java.util packages (#141) 2020-04-07 11:50:21 -04:00
Claus Holst
f809dc688e
Migrate Multicast to Kotlin Test (#146) 2020-04-07 11:48:04 -04:00
Mohammad Sianaki
59967d12fd Update AGP version 2020-04-06 11:07:40 -07:00
Dave Parker
d0d28a2c57 Prepare next development version. 2020-04-06 10:55:00 -07:00
Dave Parker
fc6505f2d0 Prepare for release 4.0.0-alpha04 2020-04-06 10:55:00 -07:00
Mez Pahlan
c512408a00
Rx get fresh bindings (#130)
* Add Rx returning equivalents of get and fetch convenience functions

* Add RxSingleStoreExtensionsTest.kt

Shows usage of Rx extension functions on Store.

* Fix test assertion

* Rename extension functions to match main module

* Add new line to end of files

Required by ktlint rules.

* Update public API

Adds the two new extension functions from this change set.

* Rename extension function names

Avoid confusion with extension functions from the main artefact.

* Add ExperimentalStdlibApi annotation to RxSingleStoreExtensionsTest
2020-03-18 08:14:35 -07:00
Claus Holst
ee133dc5a0
#126 [Feature Request] Migrate cache library to use kotlin.time APIs (#129)
* Migrate cache library to use kotlin.time APIs

* Fix docs and inline durations in tests

* Migrate cache library to use kotlin.time APIs

* Only require ExperimentalTime when setting cache expiration

* Set ExperimentalTime on RealStore to use it on MemoryPolicy

* Set ExperimentalTime on Cache interface and not on functions

* Avoid ExperimentalTime annotation in filesystem module

* Remove unneeded ExpirationTime annotation

* Remove unneeded ExpirationTime annotation
2020-03-16 14:29:19 -07:00
Claus Holst
a7ffc78c1f
Migrate filesystem library to use kotlin.time APIs #132 (#133)
* Migrate filesystem library to use kotlin.time APIs

* Remove usage of javax.inject
2020-03-16 08:09:16 -07:00
Claus Holst
5d5e89b13b
Use Kotlin version of ArrayDeque in ChannelManager (#134) 2020-03-16 08:08:32 -07:00
Said Tahsin Dane
b2ba3f76cb
Add asMap function to Cache for backward compat (#136)
* Add `asMap` function to Cache for backward compat

* Add API change
2020-03-16 08:03:38 -07:00
Yang
38baeb7c8b
Kotlin 1.3.70 and other dependencies updates. (#125)
* Update Kotlin, Gradle, binary-compatibility-validator, AGP, AndroidX, retrofit, okhttp, rx2.

* Replace deprecated @UseExperimental with @OptIn.

* Gradle 6.2.2.

* Update Coroutines to 1.3.4. Fix more compiler warnings.

* Update build-tools for travis.
2020-03-07 09:38:02 -05:00
Yigit Boyar
daa1c13ff7
Make SharedFlowProducer APIs safe (#121)
* MakeSharedFlowProducer APIs safe

This PR fixes a bug in SharedFlowProducer where it would not handle start being called
multiple times or cancel being called before start is completed. It could even consume
the upstream flow multiple times if start is called multiple times.

Fixes: #120
Test: SharedFlowProducerTest

* get rid of unnecessary start call
2020-02-29 10:01:53 -08:00
Amokrane Chentir
5be4e580a6
Fix dependency declaration in README (#122)
Use double quotes for string interpolation
2020-02-28 12:00:55 -08:00
Mez Pahlan
2a1c4b291a
Fix typo in RxStore (#119)
* Update KDoc for Store::observe

Refer to RxJava Flowable instead of Coroutine Flow.

* Update KDoc for StoreBuilder::withSinglePersister

The function `persister` is in a different class so we need to refer to
it by its FQN otherwise the IDE whinges at us.
2020-02-26 21:00:08 -05:00
S. Fatih Giriş
3c93b2465e
Update samples (#91) (#117)
* Convert RedditActivity, RoomActivity, and StreamActivity to fragment

* Add bottom navigation bar and icons

* Add navigation component and constraint layout dependency
2020-02-21 11:48:38 -05:00
Yang
66a3d3a071
Gradle 6.2. (#111)
* Gradle 6.2.

* Use single-threaded scheduler for test.

* Revert "Use single-threaded scheduler for test."
2020-02-19 13:14:14 -05:00
Yigit Boyar
6b1d5c1965
Ensure network starts after disk is established (#115)
* Ensure network starts after disk is established

This PR fixes a bug in the ordering where if disk is skipped and network
is super fast, there is a tiny chance that we wouldn't latch onto source
of truth before triggering network and that would make SourceOfTruth think
that the value was written to disk before it observed, hence become a disk
value rather than fetcher.

This PR ensures that we unlock the network only after we establish a position
in the disk read queue so that we'll know the fetcher value came afterwards.

Fixes: 114
Test: RxSingleStoreTest

* Apply suggestions from code review

* move network unlock to disk flow setup for clarity

Co-authored-by: Mike Nakhimovich <digitalbuddha@users.noreply.github.com>
2020-02-18 19:56:37 -08:00
Mike Nakhimovich
6fec8d8924
Update README.md 2020-02-18 20:12:07 -05:00
David Chang
f6f58c42c0
Fix CodeCov by changing gradle-wrapper to 6.1 (#108)
* Revert "Fix gradle wrapper version. (#102)"

This reverts commit 7cc48b79c3.

* Update gradle-wrapper

* Update gradle-wrapper
2020-02-17 06:29:53 -05:00
Mike Nakhimovich
9111d667c5
more tests! (#106)
* more tests!

* Start tracking API binary compatibility (#97)

* Configure binary-compatibility-validator plugin.

* Generate current API dumps.

* Update CONTRUBUTON.md with instruction for updating API dumps.

* ktlint fix

* newlines

* put fs eraser back in

* more tests!

* ktlint fix

* newlines

* put fs eraser back in

* run api checks

* lint

* lint

Co-authored-by: Yang <ychescale9@gmail.com>
2020-02-16 08:35:35 -05:00
David Chang
a44de986ac
Revert the version bump (#107)
* Revert "Prepare next development version."

This reverts commit 4397b4390d.

* Revert "Prepare for release 4.0.0-alpha04"

This reverts commit 671bfeaf26.
2020-02-15 14:04:11 -08:00
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
David Chang
a8cd0c98d1
Add signing capabilities to Travis (#105)
* Add signing capabilities to Travis

* Make script executable
2020-02-15 13:24:33 -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
47bc665d78
Add code coverage badge (#103) 2020-02-14 05:59:31 -05:00
David Chang
0f2134680f Update issue templates
Updating feature request
2020-02-13 20:35:11 -08:00
Yang
7cc48b79c3
Fix gradle wrapper version. (#102) 2020-02-13 19:59:02 -08:00
Yang
3e27766dad
Fix kotlin compiler warnings in store-rx2 module. (#98) 2020-02-13 20:53:53 -05:00
David Chang
328793cc0e
Add Issue templates (#99) 2020-02-13 20:53:12 -05:00
Stefan Wärting
57d8d1c240
Fix bug where RedditConfig was not persisted properly (#101) 2020-02-13 20:46:36 -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
Yang
fd2219fcde
Fix ConcurrentModificationException during Cache eviction (#90)
* Fix a ConcurrentModificationException by synchronizing the accessQueue (MutableSet) before iterating over it.

* Add test to verify ConcurrentModificationException is not thrown when performing evictions concurrently.
2020-02-05 10:25:59 -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
Mike Nakhimovich
d125a7cf29
Update README.md 2020-01-29 10:37:14 -05:00