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

Risk change dialog pops up after being dismissed (EXPOSUREAPP-3536) #1518

Conversation

SamuraiKek
Copy link
Contributor

@SamuraiKek SamuraiKek commented Nov 2, 2020

Description

This PR fixes a bug where the LiveData from the VM wasn't getting updated anymore, causing a dialog to show up every time you traveled to another screen and then returned.
Issue was caused by LiveData being filtered and once it had a value, the filter was ignoring any other state the LiveData could be in.

How to quickly test:

In RiskLevelTransaction, comment out the start() function and replace it with this one:

suspend fun start() = lockAndExecute(
        scope = transactionScope,
        timeout = RISK_LEVEL_TRANSACTION_TIMEOUT
    ) {
        lastCalculatedRiskLevelScoreForRollback.set(RiskLevelRepository.getLastCalculatedScore())
        executeUpdateRiskLevelScore(INCREASED_RISK)
        executeRiskLevelCalculationDateUpdate()
        executeClose()
        return@lockAndExecute
    }
  • Build & run the app with the "hacked" version of the start function to put the app in a high risk state.
  • Change the INCREASED_RISK to LOW_LEVEL_RISK in executeUpdateRiskLevelScore() and build & run again.
  • App should display the dialog with the low risk card in the background.
  • Pressing Ok on the dialog dismisses the dialog.
  • Navigating to a different screen and returning to the home screen won't result in a new dialog being displayed.

@SamuraiKek SamuraiKek added bug Something isn't working maintainers Tag pull requests created by maintainers labels Nov 2, 2020
@SamuraiKek SamuraiKek added this to the 1.6.0 milestone Nov 2, 2020
@SamuraiKek SamuraiKek requested a review from a team November 2, 2020 18:02
Copy link
Contributor

@AlexanderAlferov AlexanderAlferov left a comment

Choose a reason for hiding this comment

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

Tested with steps in PR description.
Smoke tested.
lgtm

BMItr
BMItr previously approved these changes Nov 2, 2020
Copy link
Contributor

@BMItr BMItr left a comment

Choose a reason for hiding this comment

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

Code looks clean to me and good to read 👌

Copy link
Contributor

@harambasicluka harambasicluka left a comment

Choose a reason for hiding this comment

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

lgtm, but I think the Project.xml shouldn't be part this PR.

.idea/codeStyles/Project.xml Outdated Show resolved Hide resolved
@harambasicluka harambasicluka changed the title Risk change dialog pops up after being dismissed - fix (EXPOSUREAPP-3536) Risk change dialog pops up after being dismissed (EXPOSUREAPP-3536) Nov 3, 2020
@sonarcloud
Copy link

sonarcloud bot commented Nov 3, 2020

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@harambasicluka harambasicluka merged commit 6ad9ff8 into release/1.6.x Nov 3, 2020
@harambasicluka harambasicluka deleted the fix/3536-risk-change-dialog-pops-up-after-being-dismissed branch November 3, 2020 09:36
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working maintainers Tag pull requests created by maintainers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants