wordpress-mobile / wordpress-mobile/WordPress-Android

Offline Support : Posts - Ensure PostListEventListener only receives post events.

Open
#11,259 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

[Type] Enhancement Offline Support Posts + Pages
Dominant language
Kotlin
Stars
3.2k
Forks
1.4k
Avg merge
1d 11h
Merged PRs (30d)
69

Description

Expected behavior

PostListEventListener with the dispatcher receives various events from FluxC. Since posts and pages are the same at the core, the PostListEventListener might end up processing events that arte meant for posts that are actually pages. So a !isPage should be added to filter out events that aren't related to posts.

Actual behavior

All events that are post related are consumed by the PostListEventListener even if they are pages.
N.B figure out a solution to do the same for media models from fun onEventBackgroundThread(event: UploadService.UploadMediaRetryEvent)

Steps to reproduce the behavior
  1. Enqueue both pages and posts while offline.
  2. Set a breakpoint within the PostListEventListener
  3. Go online and the breakpoint should be hit for both post and pages events. To verify, an event with a PostModel can be inspected to monitor the isPage property or a condition could be added to the breakpoint so it's only hit when a page is detected.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names PostListEventListener and UploadService.UploadMediaRetryEvent; start by locating those handlers and reproduce the offline queue/reconnect flow described. Confirm that post-list handling distinguishes posts from pages, then investigate the corresponding media-model behavior while checking the listener breakpoints.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
mobile-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.