Skip to content

Add checks for empty answers list to sync #252

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

Merged
merged 1 commit into from
Nov 30, 2020

Conversation

lukstbit
Copy link
Contributor

What does it fix?

Closes #249

I changed the syncAnswer() method to not mark the answer as synced if the previous call to the backend was done with an empty list of answers. I also refactored some of the Observable created for performance.

How has it been tested?

Manually, the code doesn't seem to drop answers anymore.

@lukstbit lukstbit requested a review from aniri as a code owner November 28, 2020 17:48
@lukstbit lukstbit closed this Nov 28, 2020
toaderandrei pushed a commit to toaderandrei/mon-vot-android-kotlin that referenced this pull request Nov 28, 2020
* Fixed problem when back button was not saving properly the answers.
There were two issues here, one, it could be the save answers did not
finish before syncData and two, updateAnsweredQuestion was not doing
anything as there was no emitter call at the end. This was fixed by
chaining the rxjava call under one Schedulers.io and also, by chaining
saveAnswers and syncData.
* Added more logs.
* Incorporated changes from code4romania#252.
toaderandrei pushed a commit to toaderandrei/mon-vot-android-kotlin that referenced this pull request Nov 28, 2020
* Fixed problem when back button was not saving properly the answers.
There were two issues here, one, it could be the save answers did not
finish before syncData and two, updateAnsweredQuestion was not doing
anything as there was no emitter call at the end. This was fixed by
chaining the rxjava call under one Schedulers.io and also, by chaining
saveAnswers and syncData.
* Added more logs.
* Incorporated changes from code4romania#252.
toaderandrei pushed a commit to toaderandrei/mon-vot-android-kotlin that referenced this pull request Nov 28, 2020
* Fixed problem when back button was not saving properly the answers.
There were two issues here, one, it could be the save answers did not
finish before syncData and two, updateAnsweredQuestion was not doing
anything as there was no emitter call at the end. This was fixed by
chaining the rxjava call under one Schedulers.io and also, by chaining
saveAnswers and syncData.
* Added more logs.
* Incorporated changes from code4romania#252.
@aniri aniri reopened this Nov 29, 2020
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

toaderandrei added a commit to toaderandrei/mon-vot-android-kotlin that referenced this pull request Nov 30, 2020
* Fixed problem when back button was not saving properly the answers.
There were two issues here, one, it could be the save answers did not
finish before syncData and two, updateAnsweredQuestion was not doing
anything as there was no emitter call at the end. This was fixed by
chaining the rxjava call under one Schedulers.io and also, by chaining
saveAnswers and syncData.
* Added more logs.
* Incorporated changes from code4romania#252.
@aniri aniri merged commit f6bd35c into code4romania:develop Nov 30, 2020
@lukstbit lukstbit deleted the fix_bug_249 branch November 30, 2020 16:13
aniri added a commit that referenced this pull request Dec 12, 2020
* fix send note on question

* Add simple usage for values from remote config at "About page"

* Use values from remote config for menu

* Copy files to cache instead of using directly. Fixes #178

* Remove file from cache after sending in any sync case

* Fix null string property

* Made font for selected item in the menu bold (#195)

* added collapse keyboard function (#215)

* added collapse keyboard function

* fix: keyboard collapse and opens again while switching multiple inputs

* refactor: collapseKeyboardIfFocusOutsideEditText() to Utils.kt

* Use the orderNumber field for sorting (#222)

* Use the orderNumber field for sorting

* Remove duplication for sonar

* Fix sorting for forms (#227)

* Sending firebase token on the login call (#225)

* Use filesDir instead of cacheDir (#230)

* Enable upload of multiple files with note (#231)

* Enable uploading multiple files with note

* Allow user to select multiple files

* Improve error strings for note files

* Update app/src/main/res/values-ro-rRO/strings.xml

Co-authored-by: Irina Borozan <anirib@gmail.com>

* replace: `this` with appropriate lifecycle owner (#224)

Co-authored-by: Irina Borozan <anirib@gmail.com>

* check db reset remote config flag on startup

* cleanups and add default value for remote config param

* Add sync related UI changes (#233)

* Add sync related UI changes

* small layout adjustments

* Add latest changes

Co-authored-by: Irina Borozan <anirib@gmail.com>

* removed extra activate

* Allow user to delete note files (#237)

* Allow user to delete note files

* Handle file deletion failure

* Send count of unsynced items to analytics (#244)

* Send count of unsynced items to analytics

* renamed variable to keep it consistent

Co-authored-by: Irina Borozan <anirib@gmail.com>

* fixed remote config init error and add min interval setting (#245)

* Fix RxJava null values usage (#240)

* Fix incorrect selection of counties (#247)

* Enable screen for visited polling stations (#241)

* Enable screen for visited polling stations

* Enable selecting from previously visited stations

* added visited stations icon from figma

* Implement requested changes

* Hide station selection on first run

Co-authored-by: Irina Borozan <anirib@gmail.com>

* Enable details screen for user's notes (#242)

* Enable details screen for user's notes

* Implement UI requested changes

* Fix issues with form-question codes

* Fix adding notes directly from forms list

* Tweak UI and save codes for note into database

* Update app/src/main/java/ro/code4/monitorizarevot/ui/notes/NoteDetailsFragment.kt

* Update app/src/main/res/values/strings.xml

* Apply suggestions from code review

Co-authored-by: Irina Borozan <anirib@gmail.com>

* Add info for visited stations screen (#256)

* Fix UI for notes after changing stations (#254)

* Bugfix/cleanups on app update (#257)

* refactored has selected stations shared pref

* fixed db cleanups after app update

* Add checks for empty answers list to sync (#252)

* added new link in menu and new guide (#259)

* changed logout display in menu and default safety link (#260)

Co-authored-by: Dmitriy <dekanszn@gmail.com>
Co-authored-by: caldareanda <61616802+caldareanda@users.noreply.github.com>
Co-authored-by: Avadhut Tanugade <30384908+mrwhoknows55@users.noreply.github.com>
Co-authored-by: lukstbit <52494258+lukstbit@users.noreply.github.com>
Co-authored-by: Pedro Francisco de Sousa Neto <pedrokra@gmail.com>
Co-authored-by: AlexandraDaraban <AlexandraDaraban@users.noreply.github.com>
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.

[BUG] The answer to a question is missed if pressing the back button
2 participants