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

Conversation

@AndroidMedaGalaxy
Copy link
Member

@AndroidMedaGalaxy AndroidMedaGalaxy commented Aug 7, 2020

Checklist

  • Test your changes as thoroughly as possible before you commit them. Preferably, automate your test by unit/integration tests.
  • If this PR comes from a fork, please Allow edits from maintainers
  • Set a speaking title. Format: {task_name} (closes #{issue_number}). For example: Use logger (closes # 41)
  • No submission possible : EXPOSUREAPP-1889 - Pull Requests that are not linked to an issue with you as an assignee will be closed, except for minor fixes for typos or grammar mistakes in documentation or code comments.
  • Create Work In Progress [WIP] pull requests only if you need clarification or an explicit review before you can continue your work item.
  • Make sure that your PR is not introducing unnecessary reformatting (e.g., introduced by on-save hooks in your IDE)
  • Make sure that your PR does not contain changes in text files, therefore the PR must not contain changes in values/strings/* and / or assets/* (see issue [HELP WANTED][README] Text / Translations  #332 for further information)
  • Make sure that your PR does not contain compiled sources (already set by the default .gitignore) and / or binary files

Description

if there are no keys to submit, this is handled silently and submission done screen is loaded

@AndroidMedaGalaxy AndroidMedaGalaxy requested review from a team and Fabian-K August 7, 2020 14:03
@harambasicluka harambasicluka added the maintainers Tag pull requests created by maintainers label Aug 12, 2020
@pwoessner pwoessner changed the title Fix/submission no keys Fix the submission with zero keys (EXPOSUREAPP-1742) Aug 13, 2020
Copy link
Contributor

@kolyaopahle kolyaopahle left a comment

Choose a reason for hiding this comment

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

Just one small nitpick :)

if (keys.isNotEmpty()) {
submissionViewModel.submitDiagnosisKeys(keys)
} else {
SubmissionService.submissionSuccessful()
Copy link
Contributor

Choose a reason for hiding this comment

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

Nitpick: From a separation of concerns perspective i would prefer it if the SubmissionService was not directly included in the Fragment but called from the ViewModel instead.

Copy link
Member Author

Choose a reason for hiding this comment

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

Hi Kolya, since we do not send any network request, the current way seemed like the most efficient and straight forward.

@Fabian-K what do you think of this?

Copy link
Contributor

@kolyaopahle kolyaopahle Aug 17, 2020

Choose a reason for hiding this comment

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

My main concern here is not with networking but with DI, if we later add support for DI this fragment would turn into an additional injection point for the SubmissionService, which could be avoided if we only use the SubmissionService inside of the SubmissionViewModel.

To be clear, i do not want you to create any kind of async handling for this call, i just want to move the invocation to a function inside of the SubmissionViewModel

Copy link
Member Author

Choose a reason for hiding this comment

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

@kolyaopahle changes have been made, please take a look.

Thank you

kolyaopahle
kolyaopahle previously approved these changes Aug 17, 2020
Copy link
Contributor

@kolyaopahle kolyaopahle left a comment

Choose a reason for hiding this comment

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

LGTM 👍

Comment on lines 117 to 118
BackgroundWorkScheduler.stopWorkScheduler()
LocalData.numberOfSuccessfulSubmissions(1)
Copy link
Member

Choose a reason for hiding this comment

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

The SubmissionViewModel already has the SubmissionService as a dependency. Instead of duplicating the code here, we can call SubmissionService.submissionSuccessful()

Copy link
Member Author

Choose a reason for hiding this comment

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

Had a word with Kolya yesterday, due to future changes such as DI, it was suggested that the method should be in ViewModel. I am aware of the fact that it's repeating, @kolyaopahle what do you think? I can just call the SubmissionService.submissionSuccessful() function in Viewmodel but may not be a good idea to have inter-dependencies in ViewModel and submissionService.

let me know what you think

Copy link
Member

Choose a reason for hiding this comment

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

I think the original comment referred to not adding an additional dependency to the Fragment. The ViewModel already has a dependency to SubmissionService, therefore I see no issue with this.

@sonarqubecloud
Copy link

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 d8db6eb into dev Aug 19, 2020
@harambasicluka harambasicluka deleted the fix/submission-no-keys branch August 19, 2020 06:43
@d4rken d4rken added this to the 1.3.0 milestone Oct 7, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

maintainers Tag pull requests created by maintainers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants