Every time the `CreateEngineSessionAction` is dispatched, it is processed individually by the reducer chain attached to `BrowserStore`. This _should_ mean during the first dispatch, `initializing` is false and `createEngineSession` is called. This should then dispatch a [LinkEngineSessionAction](https://searchfox.org/mozilla-mobile/rev/637910472ecaf3b2bead5521aee6d3cc3c2060d8/firefox-android/android-components/components/browser/state/src/main/java/mozilla/components/browser/state/engine/middleware/CreateEngineSessionMiddleware.kt#125), which allows the [EngineStateReducer](https://searchfox.org/mozilla-mobile/rev/637910472ecaf3b2bead5521aee6d3cc3c2060d8/firefox-android/android-components/components/browser/state/src/main/java/mozilla/components/browser/state/reducer/EngineStateReducer.kt#18) to update `BrowserState` with a non-null `engineSession`. This should trigger the observation in [EngineViewPresenter](https://searchfox.org/mozilla-mobile/rev/637910472ecaf3b2bead5521aee6d3cc3c2060d8/firefox-android/android-components/components/feature/session/src/main/java/mozilla/components/feature/session/engine/EngineViewPresenter.kt#41) and call `renderTab` with a non-null session. Typically, Stores handle dispatches through a [synchronized queue](https://searchfox.org/mozilla-mobile/rev/637910472ecaf3b2bead5521aee6d3cc3c2060d8/firefox-android/android-components/components/lib/state/src/main/java/mozilla/components/lib/state/Store.kt#95). That should mean that the order of actions is handled deterministically, and the `engineSession` should eventually become null. Either something is overwriting it before `renderTab` can complete, or the Actions get processed out of order somehow. Since this is critical infrastructure to the browser, I don't think we should risk landing a mitigation patch until we fully understand _why_ the problem is happening. We may be able to address the root cause instead.
Bug 1853107 Comment 21 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
Every time the `CreateEngineSessionAction` is dispatched, it is processed individually by the reducer chain attached to `BrowserStore`. This _should_ mean during the first dispatch, `initializing` is false and `createEngineSession` is called. This should then dispatch a [LinkEngineSessionAction](https://searchfox.org/mozilla-mobile/rev/637910472ecaf3b2bead5521aee6d3cc3c2060d8/firefox-android/android-components/components/browser/state/src/main/java/mozilla/components/browser/state/engine/middleware/CreateEngineSessionMiddleware.kt#125), which allows the [EngineStateReducer](https://searchfox.org/mozilla-mobile/rev/637910472ecaf3b2bead5521aee6d3cc3c2060d8/firefox-android/android-components/components/browser/state/src/main/java/mozilla/components/browser/state/reducer/EngineStateReducer.kt#18) to update `BrowserState` with a non-null `engineSession`. This should trigger the observation in [EngineViewPresenter](https://searchfox.org/mozilla-mobile/rev/637910472ecaf3b2bead5521aee6d3cc3c2060d8/firefox-android/android-components/components/feature/session/src/main/java/mozilla/components/feature/session/engine/EngineViewPresenter.kt#41) and call `renderTab` with a non-null session. Typically, Stores handle dispatches through a [synchronized queue](https://searchfox.org/mozilla-mobile/rev/637910472ecaf3b2bead5521aee6d3cc3c2060d8/firefox-android/android-components/components/lib/state/src/main/java/mozilla/components/lib/state/Store.kt#95). That should mean that the order of actions is handled deterministically, and the `engineSession` should eventually become null. Either something is overwriting the `engineSession` state before `renderTab` can complete successfully, or the Actions get processed out of order somehow. Since this is critical infrastructure to the browser, I don't think we should risk landing a mitigation patch until we fully understand _why_ the problem is happening. We may be able to address the root cause instead.