* Instead of keeping the EngineSessionState inside EngineSession, we now always attach it to EngineState and also do not
clear it anymore.
* If the content process gets killed we now just suspend affected EngineSession instances. They will automatically and
lazily get restored from the last EngineSessionState once needed.
* On a content process crash we now mark the EngineState as crashed and suspend the EngineSession. We will not restore
the EngineSession until explicitly restored by the application.
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.
6547: Closes https://github.com/mozilla-mobile/android-components/issues/4397: Migrate feature-readerview to browser-state r=pocmo a=csadilek
@pocmo Super happy with how the middleware worked out. It basically maps state to other (action/state), as relevant to reader view e.g. the url has changed -> a new reader check is required.
The other cases handled by the middleware are:
- User opens a tab via the context menu (may or may not switch to it directly)
- A new tab is selected
- A tab is removed (see comment in middleware)
All other functionality remains the same. Diff is big mostly because of test refactorings :)
I found another way that allows us to remove all reader state from the session right away! I am storing the state in the snapshot directly (same as `engineState`) and let the `SessionManager` deal with adding/deleting it based on the state in the store. This way we don't need to pass the store along to the serializer / session storage.
Co-authored-by: Christian Sadilek <christian.sadilek@gmail.com>
Unfortunately the implementation for this needs to live in SessionManager as long as it keeps
references to EngineSession instances and thumbnails. Therefore we determine what to trim in
SessionManager and notify BrowserStore to perform the same changes.
Hopefully in a not to distant future we can move that to BrowserStore.
6034: Closes https://github.com/mozilla-mobile/android-components/issues/6011: Integrate DebuggerDelegate to support temporary extensions r=Amejia481 a=csadilek
GeckoView calls us back now when a debug / temporary extension was installed so we can refresh the list of installed extensions to make sure action handlers are hooked up.
We're gonna have to uninstall all extensions and call `listInstalledExtensions` again to re-install everything that is there now incl. the new temporary extension. This is fine as it's for debugging purposes only.
Co-authored-by: Christian Sadilek <christian.sadilek@gmail.com>
5864: Fixed `ContextMenuFeature` and `DownloadsFeature` not working for non-selected normal tab r=pocmo a=JasonHK
- Added `BrowserState.findTabOrCustomTabOrSelectedTab` extension method.
- Fixed `ContextMenuFeature` not working for non-selected normal tab.
- Fixed `DownloadsFeature` not working for non-selected normal tab
5997: Closes https://github.com/mozilla-mobile/android-components/issues/5792: Potential deadlock between unsubscribe and dispatch r=pocmo a=csadilek
As with our previous deadlock fix, we do **not** want to change the lock on the `Subscription`, as it guarantees we never dispatch to paused or stopped observers. However, the inner lock on `subscriptions` is only there for visibility purposes. We can achieve the same, namely making sure retrievals reflect the results of the most recently completed update, by using a concurrent HashSet: A set projection of https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ConcurrentHashMap.html
This removes the potential of a deadlock and I don't see any change in semantics: The `removeSubscription` case is guarded by the `Subscription` lock and can't overlap with dispatching to the same subscription. The `addSubscription` case is guarded by the lock on the `Store` which is also required for `dipsatching`, so add and dispatch can't overlap either.
@pocmo wdyt?
6008: Bug 1615248 - add missing nightly entry in .cron.yml r=pocmo a=MihaiTabara
Follow-up from https://github.com/mozilla-mobile/android-components/pull/5967, I forgot to add its `cron.yml` corresponding entry for nightly releases.
Co-authored-by: Jason Kwok <JasonHK@users.noreply.github.com>
Co-authored-by: Christian Sadilek <christian.sadilek@gmail.com>
Co-authored-by: Mihai Tabara <mtabara@mozilla.com>