Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

For #12201 - forced sync layout callbacks to be on the main thread #12543

Conversation

BranescuMihai
Copy link
Contributor

The account manager from AC works similar to the store that we have (so it has states and a reducer), however it delivers the result to consumers via old-school observer pattern, and since the reducer is on a different thread, all consumers are notified on that thread as well.

This consumer needs to perform UI changes, so it's required to be on main thread for that to happen. I chose to set only this consumer on the main thread and not switch context in the account manager reducer, because some consumers do computation and should remain on the separate thread.

Pull Request checklist

  • Tests: This PR includes thorough tests or an explanation of why it does not
  • Screenshots: This PR includes screenshots or GIFs of the changes made or an explanation of why it does not
  • Accessibility: The code in this PR follows accessibility best practices or does not include any user facing features. In addition, it includes a screenshot of a successful accessibility scan to ensure no new defects are added to the product.

After merge

  • Milestone: Make sure issues finished by this pull request are added to the milestone of the version currently in development.

To download an APK when reviewing a PR:

  1. click on Show All Checks,
  2. click Details next to "Taskcluster (pull_request)" after it appears and then finishes with a green checkmark,
  3. click on the "Fenix - assemble" task, then click "Run Artifacts".
  4. the APK links should be on the left side of the screen, named for each CPU architecture

@codecov-commenter
Copy link

Codecov Report

Merging #12543 into master will decrease coverage by 0.03%.
The diff coverage is 0.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #12543      +/-   ##
============================================
- Coverage     23.66%   23.62%   -0.04%     
  Complexity      798      798              
============================================
  Files           377      377              
  Lines         15478    15483       +5     
  Branches       2020     2020              
============================================
- Hits           3663     3658       -5     
- Misses        11507    11515       +8     
- Partials        308      310       +2     
Impacted Files Coverage Δ Complexity Δ
...in/java/org/mozilla/fenix/sync/SyncedTabsLayout.kt 7.50% <0.00%> (-1.08%) 0.00 <0.00> (ø)
...mponents/searchengine/FenixSearchEngineProvider.kt 58.55% <0.00%> (-4.51%) 14.00% <0.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 67758ab...22c6e73. Read the comment docs.

Copy link

@eliserichards eliserichards left a comment

Choose a reason for hiding this comment

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

Looks great!

@eliserichards eliserichards merged commit 9373e7f into mozilla-mobile:master Jul 16, 2020
@liuche liuche mentioned this pull request Jul 20, 2020
9 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants