Skip to content

Offline Support : Pages - PostUploadComplete logic issue #11263

Description

@jd-alexander

Expected behavior

When the page is uploaded and it needs to be refreshed to show the changes that took place, it should simply run a refresh from the database since it was updated and we are getting the completed event.

private suspend fun reloadPages(state: PageListState = REFRESHING) {

The function above could be renamed to fetchPagesFromServerAndRefreshUi to make it clear what it does, since it's possible that this bug was caused by reloadPages and refreshPages being close in name and intent.

Actual behavior

The entire page is basically reloaded; the page is re-fetched from the server which isn't necessary in this case.

Steps to reproduce the behavior

  1. Switch to this branch Offline Pages : PageList Item Progress State  #11191
  2. Trigger an upload and if you put a breakpoint in the function below you will see that the pages are being fetched and the "local changes" if it exists will have a delay with being refreshed.
    private suspend fun reloadPages(state: PageListState = REFRESHING) {
Tested on Google Pixel 3a, Android 10, WPAndroid #11191

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions