Refactor duplicated verifiables scope overrides back to generic ReplicableModel implementation
Problem
Currently, several Geo replicable models have nearly identical verifiables scope overrides that differ from the generic scope in ReplicableModel only in parameter handling. This creates code duplication and maintenance overhead, which are necessary for progressing the selective sync scope work.
Current State
- Multiple replicable models override the
verifiablesscope with similar implementations - The overrides were introduced to fix query performance issues where unbounded queries were retrieving all
project_idsfrom the database instead of limiting to a maximum of 10,000 records - The parameter differences are needed to properly scope the
replicable_project_idsin theselective_sync_scope
Proposed Solution
Once all replicable models have been updated with the necessary parameter fixes as part of the selective sync scope epic, refactor the duplicated code back to the generic ReplicableModel implementation.
This would:
- Eliminate code duplication across multiple replicable models
- Centralize the logic in the appropriate base class
- Maintain the performance improvements while reducing maintenance overhead
- Ensure consistent behavior across all replicable models
Context
This refactoring was deferred from MR !208207 (merged) to keep that MR focused and smaller. The current approach was chosen to fix performance issues in specific models without touching every replicable model at once.
Acceptance Criteria
-
Remove duplicated verifiablesscope overrides from individual replicable models -
Update the generic scope in ReplicableModelto handle the parameter requirements -
Ensure all existing functionality and performance improvements are preserved -
Verify that all replicable models work correctly with the generic implementation
Reference
Edited by Chloe Fons