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

fix: Prevent false error while creating events #1567

Merged
merged 2 commits into from
Mar 20, 2019
Merged

fix: Prevent false error while creating events #1567

merged 2 commits into from
Mar 20, 2019

Conversation

ShridharGoel
Copy link
Member

Fixes #1514

Checklist:

  • I have checked for PMD and check-style issues
  • I have read the Contribution & Best practices Guide and my PR follows them.
  • My branch is up-to-date with the Upstream development branch.

Changes:

Passed the context of the activity instead of the EventDetailsStepThree and UpdateEventFragment fragments in ViewModelProviders to prevent the 'Event name cannot be empty' error message.
Because of this, SingleEventLiveData had to be changed to MutableLiveData.

@codecov
Copy link

codecov bot commented Mar 19, 2019

Codecov Report

Merging #1567 into development will not change coverage.
The diff coverage is 0%.

Impacted file tree graph

@@              Coverage Diff               @@
##             development    #1567   +/-   ##
==============================================
  Coverage          24.83%   24.83%           
  Complexity           800      800           
==============================================
  Files                238      238           
  Lines               8952     8952           
  Branches             368      368           
==============================================
  Hits                2223     2223           
  Misses              6645     6645           
  Partials              84       84
Impacted Files Coverage Δ Complexity Δ
...anizer/core/event/create/CreateEventViewModel.java 0% <0%> (ø) 0 <0> (ø) ⬇️
...ganizer/core/event/create/UpdateEventFragment.java 0% <0%> (ø) 0 <0> (ø) ⬇️
...nizer/core/event/create/EventDetailsStepThree.java 0% <0%> (ø) 0 <0> (ø) ⬇️

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 8a19cef...3519ca9. Read the comment docs.

@kush-mish
Copy link
Contributor

kush-mish commented Mar 20, 2019

But what about the error messages which were mentioned here?

@ShridharGoel
Copy link
Member Author

@kush-mish Everything is working fine except the case when internet connection isn't available. This PR can be considered as a temporary fix for the problem of not being able to create events.

@iamareebjamal
Copy link
Member

I don't understand why these changes will affect the errors?

@ShridharGoel
Copy link
Member Author

I am also not sure about the strange behaviour. I think it's because the logic for handling the functioning of the next button (clicking which calls the verify function) is in the activity while we were passing the context of the fragments in the ViewModelProviders.

@iamareebjamal
Copy link
Member

That's understandable. But why change single event livedata?

@ShridharGoel
Copy link
Member Author

Because using SingleEventLiveData would give Only one observer at a time may subscribe to a SingleEventLiveData error since the same ViewModel is being shared by multiple fragments.

@ShridharGoel
Copy link
Member Author

I had changed it to SingleEventLiveData in #1487 but it has created this issue.

@iamareebjamal iamareebjamal merged commit 0839682 into fossasia:development Mar 20, 2019
@ShridharGoel ShridharGoel deleted the issue1514 branch March 20, 2019 15:35
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.

3 participants