Skip to content

fix pagingsource crash#1104

Merged
Tlaster merged 1 commit intomasterfrom
bugfix/paging_crash
Jul 17, 2025
Merged

fix pagingsource crash#1104
Tlaster merged 1 commit intomasterfrom
bugfix/paging_crash

Conversation

@Tlaster
Copy link
Copy Markdown
Contributor

@Tlaster Tlaster commented Jul 16, 2025

No description provided.

@Tlaster Tlaster requested a review from Copilot July 16, 2025 05:41
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 BaseTimelinePagingSource with BaseTimelinePagingSourceFactory that 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

@Tlaster Tlaster merged commit 7d61455 into master Jul 17, 2025
5 checks passed
@Tlaster Tlaster deleted the bugfix/paging_crash branch July 17, 2025 03:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants