Wordpress-android: PagesViewModel - pageUpdateContinuations logic investigation

Created on 5 Feb 2020  路  3Comments  路  Source: wordpress-mobile/WordPress-Android

While working on #11191 we stumbled on continuation logic before that's responsible for continuing a page operation that was suspended waiting on a result.

https://github.com/wordpress-mobile/WordPress-Android/blob/59778060ca0dd6b716ba60ea8a727fa6a0d4137c/WordPress/src/main/java/org/wordpress/android/viewmodel/pages/PagesViewModel.kt#L687

The first part of the function that checks if the id is contained and then sets it as the id isn't clear; we aren't sure what it supposed to do. This issue is to track this behavior so that it gets investigated.

Pages List [Pri] Low [Type] Bug

All 3 comments

Just to elaborate a bit more: The unclear part is that we create val id and we set it to 0. The next statement is checking if pageUpdateContinuations contains 0. My guess is that we should be checking if it contains event.post.remotePostId not id.

I'm moving this ticket outside of the scope of "Offline Pages" since the code was introduced long before.

The logic/code described in the issue above was removed due to issues that were being caused when a continuation representing a post's upload was being resumed twice. Since the action it was bind to isn't needed anymore, i.e the buttons don't have to be disabled during upload because we have an overlay bound to the progress that blocks the user from clicking them.
For more details, see this PR https://github.com/wordpress-mobile/WordPress-Android/pull/11628

Was this page helpful?
0 / 5 - 0 ratings