wordpress-mobile / wordpress-mobile/WordPress-Android
Offline Support : Posts - Ensure PostListEventListener only receives post events.
Nobody has claimed this yet.
- 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
- Enqueue both pages and posts while offline.
- Set a breakpoint within the
PostListEventListener - Go online and the breakpoint should be hit for both post and pages events. To verify, an event with a
PostModelcan be inspected to monitor theisPageproperty or a condition could be added to the breakpoint so it's only hit when a page is detected.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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