Filter history: foundation (feature flag + Room persistence) - #16420
Filter history: foundation (feature flag + Room persistence)#16420AdamGrzybkowski wants to merge 3 commits into
Conversation
Adds FILTER_HISTORY flag, FilterHistoryEntity/Dao in WCAndroidDatabase (v92) and a per-site FilterHistoryRepository. Part 1 of WOOMOB-3326 (WOOMOB-3824).
Generated by 🚫 Danger |
There was a problem hiding this comment.
AI Code Review - No issues found. The changes look good.
This is a well-scoped foundation PR (feature flag + Room persistence for filter history). The DB version bump 91→92 adds a brand-new empty table via AutoMigration(91, 92), which Room handles automatically, and the schema 92.json is committed — the migration is deploy-safe. The dedup-by-payload contract (unique index on (localSiteId, filterType, payload) + OnConflictStrategy.REPLACE) is implemented correctly and well covered by the DAO tests (dedup/bump, site isolation, clear scoping, newest-first ordering). No correctness, security, or backwards-compatibility concerns.
Automatic review · claude-opus-4-8 · Workflow run
How to reply to a finding
Reply on this review (or inline at the line the finding refers to) with one of:
@claude addressed- I made the change. Bot verifies against the next diff before marking resolved.@claude rejected: <reason>- Will not fix; reason gets quoted on the next review.@claude not-applicable- Finding does not apply (wrong file, already covered elsewhere, etc.).
The bot honours these on the next review pass.
|
|

Part of WOOMOB-3326 — WOOMOB-3824
Description
First of a stack of PRs adding filter history to the order and product lists (feature request WOOMOB-31, matching the iOS implementation). Everything is gated behind the new
FILTER_HISTORYfeature flag and is not user-visible yet.This foundation PR adds the persistence layer only — no UI:
FILTER_HISTORYfeature flag (woo_filter_history, debug-on).FilterHistorytable (entity + DAO) added to FluxC'sWCAndroidDatabase(version 91 → 92, one auto-migration), following the Support Chat bookmark precedent.FilterHistoryRepositoryexposing per-surfaceobserve/save/remove/clear, with dedup + newest-first + unlimited history (matching iOS), and aSavedFilterdomain model.The stored
payloadis an opaque, per-surface serialization (decoded by the order/product screens in later PRs), so adding new filters later needs no schema migration.Test Steps
No user-facing behaviour. CI green is the bar:
./gradlew :libs:fluxc-plugin:testDebugUnitTest --tests "*FilterHistoryDaoTest*"— covers dedup / newest-first / delete / clear / per-site isolation on an in-memory DB.Stacked PRs
This is PR 1 of 4, targeting
trunk. The rest target the previous branch:trunk