Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes a PagingSource crash by refactoring the architecture to use a factory pattern for creating PagingSource instances. This addresses the issue where PagingSource instances were being reused across multiple Pager configurations, which can cause crashes in the Paging library.
- Replaces
BaseTimelinePagingSourcewithBaseTimelinePagingSourceFactorythat creates new instances - Updates all implementations to use the factory pattern with lambda-based creation
- Improves error handling by throwing explicit exceptions instead of filtering null values
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| TimelinePresenter.kt | Updates timeline presenter to use factory pattern and call create() method |
| AccountRepository.kt | Replaces mapNotNull with explicit exception throwing for better error handling |
| GuestUserTimelinePagingSource.kt | Changes inheritance from BaseTimelinePagingSource to BasePagingSource |
| GuestTimelinePagingSource.kt | Changes inheritance from BaseTimelinePagingSource to BasePagingSource |
| GuestStatusDetailPagingSource.kt | Changes inheritance from BaseTimelinePagingSource to BasePagingSource |
| GuestSearchStatusPagingSource.kt | Changes inheritance from BaseTimelinePagingSource to BasePagingSource |
| GuestMastodonDataSource.kt | Wraps all PagingSource returns with BaseTimelinePagingSourceFactory |
| BaseRemoteMediator.kt | Defines new BaseTimelinePagingSourceFactory interface and removes old abstract class |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.