Skip to content
This repository was archived by the owner on Nov 1, 2022. It is now read-only.

Conversation

@mcarare
Copy link
Contributor

@mcarare mcarare commented Mar 26, 2020


Pull Request checklist

  • Quality: This PR builds and passes detekt/ktlint checks (A pre-push hook is recommended)
  • Tests: This PR includes thorough tests or an explanation of why it does not
  • Changelog: This PR includes a changelog entry or does not need one
  • Accessibility: The code in this PR follows accessibility best practices or does not include any user facing features

After merge

  • Milestone: Make sure issues closed by this pull request are added to the milestone of the version currently in development.
  • Breaking Changes: If this is a breaking change, please push a draft PR on Reference Browser to address the breaking issues.

@codecov
Copy link

codecov bot commented Mar 26, 2020

Codecov Report

Merging #6401 into master will decrease coverage by 0.36%.
The diff coverage is 0%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #6401      +/-   ##
============================================
- Coverage     78.55%   78.19%   -0.37%     
+ Complexity     4603     4419     -184     
============================================
  Files           610      589      -21     
  Lines         22209    21630     -579     
  Branches       3253     3176      -77     
============================================
- Hits          17447    16914     -533     
+ Misses         3431     3409      -22     
+ Partials       1331     1307      -24
Impacted Files Coverage Δ Complexity Δ
...lla/components/browser/state/selector/Selectors.kt 93.33% <0%> (-6.67%) 0 <0> (ø)
...rt/migration/session/InMemorySessionStoreParser.kt 91.66% <0%> (-2.46%) 8% <0%> (ø)
...onents/service/experiments/ExperimentDescriptor.kt
...illa/components/service/experiments/Experiments.kt
...a/components/service/experiments/ValuesProvider.kt
...nts/browser/tabstray/thumbnail/TabThumbnailView.kt
...onents/service/experiments/JSONExperimentParser.kt
...s/service/experiments/FlatFileExperimentStorage.kt
...mponents/service/experiments/util/VersionString.kt
...la/components/service/experiments/Configuration.kt
... and 21 more

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 2b11861...be7cbcf. Read the comment docs.

*/
fun findSessionByUrl(url: String): Session? = synchronized(values) {
values.firstOrNull { session -> session.url == url }
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it be possible to implement this as an extension function in browser-state on BrowserState instead? If possible I would like to avoid adding anything new to SessionManager anymore since we are trying to get rid of it.

Even here I think you would want to maybe limit it to sessions instead of values to not search in custom tabs and web apps?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

One question: Presumably I get an existingTab:TabSessionState. How can I use that to navigate to the opened tab?
Without using something like :
sessionManager.findSessionById(existingTab.id)?.let { sessionManager.select(it) }

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, we'd still need this workaround "translation" code. That will be something we can get rid of once we start migrating Fenix code from SessionManager to BrowserStore. But at least we do not add new functionality that will end up getting called in various places makign things harder to migrate. :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree, I just wanted to see if there is something already migrated so I could avoid using sessionManager in yet another place in Fenix. Thank you for the details!

@Amejia481 Amejia481 added the 🕵️‍♀️ needs review PRs that need to be reviewed label Mar 30, 2020
@mcarare mcarare requested a review from pocmo April 2, 2020 10:42
Copy link
Contributor

@pocmo pocmo left a comment

Choose a reason for hiding this comment

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

bors r+

@bors
Copy link

bors bot commented Apr 2, 2020

Build succeeded

@bors bors bot merged commit 6f30486 into mozilla-mobile:master Apr 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

🕵️‍♀️ needs review PRs that need to be reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants