MobileNativeFoundation / Store

A Kotlin Multiplatform library for building network-resilient applications
https://mobilenativefoundation.github.io/Store/
Apache License 2.0
3.16k stars 197 forks source link

Emit data into collected stream after write or fetch with no SourceOfTruth #634

Open filanjuraj opened 5 months ago

filanjuraj commented 5 months ago

Closes #541

Description

Writing into Store doesnt emit data into collected stream (reading from Store), also when collecting stream with localOnly request. Happens only if you don't provide SourceOfTruth.

Steps to reproduce the behavior:

Writing into store:

  1. Start collecting stream (read from Store with key X)
  2. Write into Store new data with key X
  3. Collected stream doesnt receive the new data
  4. Start collecting stream again (read from store with key X) gives you the new data

Collecting stream with LocalOnly request:

  1. Start collecting strean with LocalOnly request with key X
  2. Fetch new data with key X
  3. Collected stream doesnt receive the new data
  4. Start collecting stream again (read from store with key X) gives you the new data

Type of Change

Test Plan

Added new tests. Tested in sample app.

Checklist:

Before submitting your PR, please review and check all of the following:

Additional Notes:

Add any other information about the PR here.