Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PWN-877 - add PNL feature toggle #2178

Merged
merged 2 commits into from
Feb 6, 2024
Merged

Conversation

gslevinkov
Copy link
Contributor

Jira Ticket

https://p2pvalidator.atlassian.net/browse/

Description of Work

[ what work was done in this ticket ]

Screenshots (Optional)

Screenshot #1 Screenshot #2 Screenshot #3
[Paste Pic 1] [Paste Pic 2] [Paste Pic 3]

Copy link

github-actions bot commented Feb 6, 2024

Code coverage report

File Coverage [66.67%] Min. Covered
PnlEnabledFeatureToggle.kt 0.00% 💩
TokenHistoryPresenter.kt 0.00% 💩
MyCryptoPresenter.kt 0.00% 💩
MyCryptoMapper.kt 0.00% 💩
PnlDataObserver.kt 0.00% 💩
PnlDataState.kt 0.00% 💩
PnlRemoteRepository.kt 0.00% 💩
PnlUiMapper.kt 0.00% 💩
Total Project Coverage 4.82% 💩

@@ -87,7 +87,7 @@ class MyCryptoPresenter(
// pnl must restart it's 5 minutes timer after force refresh
// and we should restart it only if it was initially started
// other cases might indicate that we didn't start observer due to empty state
if (pnlInteractor.isStarted()) {
if (!pnlInteractor.canBeStarted()) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

it looks there are logical mistake: if it can't be started - restart
I suppose you wanted to check whether it can be started at all, considering feature toggle condition, in this case you need to add one more if:

if(pnlIntereactor.canBeStarted() && pnlInteractor.isStarted()) {
    pnlInteractor.restartAndRefresh()
}

checking for "isStarted" is necessary here, because we should restart only if it was initially started after the first tokens load (see handleTokenState is UserTokensState.Loaded block)

@gslevinkov gslevinkov merged commit 150d644 into develop Feb 6, 2024
3 of 4 checks passed
@gslevinkov gslevinkov deleted the feature/PWN-877-ft-pnl branch February 6, 2024 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants