Skip to content

refactor(db-repository): extract folder query operations to FolderQueryRepository - #11481

Open
rafaeltonholo wants to merge 1 commit into
chore/11470/split-folder-repository-part-3from
chore/11470/split-folder-repository-part-4
Open

refactor(db-repository): extract folder query operations to FolderQueryRepository#11481
rafaeltonholo wants to merge 1 commit into
chore/11470/split-folder-repository-part-3from
chore/11470/split-folder-repository-part-4

Conversation

@rafaeltonholo

Copy link
Copy Markdown
Member

Contribution Summary

Linked Issue/Ticket: Resolves #11470

Description

  • Add FolderQueryRepository interface with findById, findFolderServerIdById, findIdByServerId, and isPresent methods
  • Add DefaultFolderQueryRepository implementation
  • Remove folder query methods from FolderRepository interface
  • Update consumers to use new repository: UnreadWidgetDataProvider, SettingsExporter, GetAccountFolders, MessageDetailsViewModel, K9BackendStorageFactory, and AutoExpandFolderBackendFoldersRefreshListener
  • Make BackendFoldersRefreshListener.onAfterFolderListRefresh suspend function
  • Make SettingsExporter.writeFolderNameSettings and UnreadWidgetRepository.upgradePreferences suspend functions
  • Add comprehensive tests for DefaultFolderQueryRepository
  • Remove FakeFolderRepository in favour of repository-specific fakes

AI Disclosure

Select one of the following (mandatory)

  • This contribution does not include any changes created or assisted by AI.
  • This contribution includes changes assisted by AI.
  • This contribution includes changes created by AI.

Contribution Checklist

  • I have read and affirm that my contribution adheres to Mozilla’s Community Participation Guidelines
  • This contribution is in Kotlin where possible
  • This contribution does not use merge commits
  • This contribution adheres to the existing codestyle (run gradlew spotlessCheck to check and gradlew spotlessApply to format your source code; will be checked by CI).
  • This contribution does not break existing unit tests (run gradlew testDebugUnitTest; will be checked by CI).
  • This contribution includes tests for any new functionality, and maintains tests for any updated functionality.
  • This contribution adheres to our Engineering process (RFC/Technical Design/ADR)
  • This PR has a descriptive title and body that accurately outlines all changes made, and contains a reference to any issues that it fixes (e.g. Closes #XXX or Fixes #XXX).

Stack created with GitHub Stacks CLIGive Feedback 💬

@rafaeltonholo
rafaeltonholo requested a review from a team as a code owner September 1, 2026 16:07
@rafaeltonholo
rafaeltonholo requested review from jbott-tbird and removed request for a team September 1, 2026 16:07
@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Validation Passed: All report and feature-flag labels are correctly set.

@rafaeltonholo rafaeltonholo added the report: exclude Exclude changes from user-facing reports (internal, minor, or not relevant to users). label Sep 1, 2026
@github-actions github-actions Bot added the tb-team Tasks and features handled by project maintainers label Sep 1, 2026
@rafaeltonholo
rafaeltonholo force-pushed the chore/11470/split-folder-repository-part-4 branch from 5905bfb to 67ac36f Compare September 2, 2026 10:50
@rafaeltonholo
rafaeltonholo requested review from wmontwe and removed request for jbott-tbird September 2, 2026 11:58
@rafaeltonholo rafaeltonholo assigned wmontwe and unassigned jbott-tbird Sep 2, 2026
@rafaeltonholo
rafaeltonholo force-pushed the chore/11470/split-folder-repository-part-4 branch from 67ac36f to d962d68 Compare September 3, 2026 14:17
@rafaeltonholo
rafaeltonholo force-pushed the chore/11470/split-folder-repository-part-4 branch from d962d68 to d16cba0 Compare September 4, 2026 10:50
…itories

- Add RemoteFolderQueryRepository interface with getAllByAccountId method
- Add RemoteFolderDetailsRepository interface with getAllByAccountId method
- Add DefaultRemoteFolderQueryRepository and DefaultRemoteFolderDetailsRepository implementations
- Remove getRemoteFolders and getRemoteFolderDetails from FolderRepository
- Update GetAccountFolders, AccountSettingsViewModel, DefaultDisplayFolderRepository, DefaultSpecialFolderUpdater, and FolderSettingsProvider to use new repositories
- Make SettingsExporter.exportPreferences and related methods suspend functions
- Make FolderSettingsChangedListener.onFolderSettingsChanged suspend function and notify on main immediate dispatcher
- Migrate RemoteFolderDetails from data class to typealias referencing API module
@rafaeltonholo
rafaeltonholo force-pushed the chore/11470/split-folder-repository-part-4 branch from d16cba0 to ebb507e Compare September 4, 2026 18:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

report: exclude Exclude changes from user-facing reports (internal, minor, or not relevant to users). tb-team Tasks and features handled by project maintainers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Global Database 0.1.8 — Repository pattern — Split FolderRepository into smaller repositories

3 participants