Commit Graph

24 Commits

Author SHA1 Message Date
Sebastian Kaspari
212c7d73c1 [components] Issue https://github.com/mozilla-mobile/android-components/issues/7867: Move EngineSession from SessionManager to BrowserState.
Co-authored-by: Christian Sadilek <christian.sadilek@gmail.com>

Issue https://github.com/mozilla-mobile/android-components/pull/8121: Replace MigrationStore with MigrationContext and prevent usage outside of a Middleware.

* Before executing the reducer chain we now verify that we are on the store thread and throw if we are on a different thread.
* MigrationContext now provides a store property that returns the underlying Store instance. This can be used to pass it to
  other components and threads that are not part of the Middleware.
* Fixed existing Middleware implementations to use the MiddlewareContext or pass the actual Store instance around.
2020-08-26 10:50:47 -04:00
Tiger Oakes
97a49470bd [components] Remove roboletric runner for some lib tests 2020-07-01 10:10:30 -07:00
Tiger Oakes
c6c313f409 [components] Update lifecycle version 2020-05-20 13:46:06 -07:00
Jonathan Almeida
b86fa6dfb5 [components] Close https://github.com/mozilla-mobile/android-components/issues/6601: Update targetSdkVersion to 29 2020-04-28 03:16:54 -04:00
Sebastian
20a9a3bf3f [components] Issue https://github.com/mozilla-mobile/android-components/issues/6235: lib-state/browser-state: Add support for middleware. 2020-03-13 18:17:20 +01:00
Christian Sadilek
55df692652 [components] Closes https://github.com/mozilla-mobile/android-components/issues/5792: Potential deadlock between unsubscribe and dispatch 2020-02-19 16:00:23 -05:00
Christian Sadilek
5347ca064d [components] Closes https://github.com/mozilla-mobile/android-components/issues/5783: Deadlock when dispatching actions during lifecycle change 2020-02-03 11:25:38 -05:00
Tiger Oakes
1bdf8c8234 [components] Add JUnit coroutine test rule 2019-11-18 19:52:50 -08:00
Denys M
b95c932f81 [components] For https://github.com/mozilla-mobile/android-components/issues/4460. Fix detekt warning about license in project files. 2019-09-24 01:01:03 +04:00
Sebastian Kaspari
2c3b41aa37 [components] Update AndroidX dependencies.
Follow-up issues:
* https://github.com/mozilla-mobile/android-components/issues/4379
* https://github.com/mozilla-mobile/android-components/issues/4378
2019-09-11 14:25:23 +02:00
Sebastian Kaspari
32adde534b [components] Issue https://github.com/mozilla-mobile/android-components/issues/3786: Make LifecycleOwner parameter for Store.flow() and Store.flowScoped() optional (primarily for testing). 2019-09-03 14:17:55 +02:00
Sebastian Kaspari
a3a29954af [components] Issue https://github.com/mozilla-mobile/android-components/issues/3786, https://github.com/mozilla-mobile/android-components/issues/3530: Add Store extensions to observe State using the Flow API. 2019-08-30 15:54:07 +02:00
Sebastian Kaspari
8ccc74ddad [components] Closes https://github.com/mozilla-mobile/android-components/issues/4125: Fragment.consumeFrom(): Temporarily check whether fragment is added. 2019-08-19 11:08:24 +02:00
Sebastian Kaspari
bfbcbf95ea [components] Turn Store.broadcastChannel() into Store.channel() and return just a ReceiveChannel.
Broadcast channels have a complicated lifetime since they can have multiple subscribers. This
means a broadcast channel can stay alive longer than there are subscribers. Using a ReceiveChannel,
which can only have one receiver, simplifies this greatly. Also this guarantees that invokeOnClose()
gets invoked when the channel gets closed AND when the receiver is cancelled (from consume()).

On top of that we do not really need the broadcast functionality. As of now we always will only
have a single consumer of the channel. And if that ever changes we can either create multiple
channels or use Kotlin's ReceiveChannel.broadcast() extension method.
2019-07-25 10:05:09 -04:00
Sebastian Kaspari
e4db77e955 [components] Issue https://github.com/mozilla-mobile/android-components/pull/3083: lib-state: Add unit tests for consumeFrom helpers. 2019-07-24 11:54:20 +02:00
Sebastian Kaspari
244721135e [components] Issue https://github.com/mozilla-mobile/android-components/pull/3083: Do not close channel from consumeFrom() since that is handled internally.
Co-authored-by: Christian Sadilek <christian.sadilek@gmail.com>
2019-07-24 11:54:20 +02:00
Sebastian Kaspari
a87424b6d2 [components] Issue https://github.com/mozilla-mobile/android-components/issues/3803: Add helper methods to consume state from a store with fragment or view scope.
Co-authored-by: Christian Sadilek <christian.sadilek@gmail.com>
2019-07-24 11:54:20 +02:00
Sebastian Kaspari
275cd77618 [components] Issue https://github.com/mozilla-mobile/android-components/issues/3803: Add Store.broadcastChannel() extension method to observe state changes from a channel.
Co-authored-by: Christian Sadilek <christian.sadilek@gmail.com>
2019-07-24 11:54:20 +02:00
Sebastian Kaspari
76e88d170d [components] Issue https://github.com/mozilla-mobile/android-components/issues/3803: lib-state: Add ability to pause and resume store subscriptions and use it for View and Lifecycle binding.
Co-authored-by: Christian Sadilek <christian.sadilek@gmail.com>
2019-07-24 11:54:20 +02:00
Christian Sadilek
dab920cc5c [components] Issue https://github.com/mozilla-mobile/android-components/issues/3563: Introduce StoreException for errors caught in Store/Reducer 2019-07-05 17:22:38 +02:00
Sebastian Kaspari
0d867da2b0 [components] Closes https://github.com/mozilla-mobile/android-components/issues/3563: BrowserStore: Rethrow exceptions on the main thread. 2019-07-04 18:08:50 +02:00
Sebastian Kaspari
38f8ab1ce6 [components] Restructure (reduced) BrowserState and add tests. 2019-06-25 17:13:49 +02:00
Tiger Oakes
ef5601825e [components] Add documentation for lib-state 2019-06-25 10:35:42 +02:00
Sebastian Kaspari
234928260e [components] browser-state: Move state handling to generic lib-state component. 2019-06-24 07:57:54 -07:00