Skip to content

Conversation

@digitalbuddha
Copy link
Contributor

closes #124 and #254
Currently, stores will only emit more than one error if a source of truth is not set.
One too many users have gotten confused by current behavior.
This diff makes behavior same for stores with and without source of truth.
End result is pull to refresh that uses store.fresh as side effect will work closer to user expectations

@yigit @eyalgu

@codecov
Copy link

codecov bot commented Feb 3, 2021

Codecov Report

Merging #257 (73956cd) into main (b83ec8b) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##               main     #257      +/-   ##
============================================
- Coverage     83.02%   83.00%   -0.02%     
+ Complexity      184      182       -2     
============================================
  Files            48       48              
  Lines           860      859       -1     
  Branches        129      129              
============================================
- Hits            714      713       -1     
  Misses           80       80              
  Partials         66       66              
Impacted Files Coverage Δ Complexity Δ
.../android/external/store4/impl/FetcherController.kt 100.00% <100.00%> (ø) 5.00 <0.00> (-2.00)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b83ec8b...73956cd. Read the comment docs.

eyalgu
eyalgu previously approved these changes Feb 3, 2021
* act like a [SourceOfTruth] in the lack of a [SourceOfTruth] provided by the developer.
*/
private val enablePiggyback: Boolean = sourceOfTruth == null
private val enablePiggyback: Boolean = true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

inline

class RefreshTest {

@Test
fun refreshWithError() = runBlocking {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add a test with no SOT case

@digitalbuddha digitalbuddha merged commit 7ba28a8 into main Feb 4, 2021
rallat pushed a commit that referenced this pull request Aug 13, 2021
* add piggyback to all stores

* lint

* pr feedback

Co-authored-by: miken <miken@dropbox.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request] Improved Support for Pull to Refresh

3 participants