Skip to content

refactor: migrate PhishingController data fetching to PhishingDataService - #9914

Draft
0xOhm wants to merge 1 commit into
mainfrom
refactor/psafe-593-phishing-data-service
Draft

refactor: migrate PhishingController data fetching to PhishingDataService#9914
0xOhm wants to merge 1 commit into
mainfrom
refactor/psafe-593-phishing-data-service

Conversation

@0xOhm

@0xOhm 0xOhm commented Aug 20, 2026

Copy link
Copy Markdown

Description

Extracts all remote data fetching from PhishingController into a new PhishingDataService built on the BaseDataService pattern (PSAFE-593). CacheManager is removed in favor of the service's built-in caching, persistence, and request coalescing.

Changes

  • New PhishingDataService owning all four remote APIs (stalelist/hotlist, request-blocklist/C2, dapp scanning, token/address scanning) with generated method action types
  • PhishingController slimmed to detection/state logic; queries data through the service via the messenger
  • CacheManager removed — caching, persistence (StorageService), and request coalescing now come from BaseDataService
  • Response validation intentionally kept loose (e.g. token scan result_type as string, not enum) to match pre-refactor behavior — production already returns values outside the documented enum (Verified)

Verification

  • 501 unit tests / 7 suites, 100% stmt/fn/line coverage, 99.29% branch
  • Full monorepo build clean against the new API
  • Live production API contract: 9/9 endpoints accepted by validation
  • Outage simulation: detection fails open to stale lists (never off), bounded retries
  • Persistence lifecycle: rehydration after simulated MV3 SW restart with zero network; maxAge-expired verdicts discarded
  • Coalescing parity: 120-token chunking, miss-only fetch, zero-fetch cached batches

Client integration PRs

  • Extension and mobile integration PRs to follow (wiring + state migrations); they depend on this merging and publishing first.

🤖 Generated with Claude Code

…vice

Extract all remote data fetching from PhishingController into a new
PhishingDataService built on the BaseDataService pattern. Removes
CacheManager in favor of the service's built-in caching, persistence,
and request coalescing.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.

1 participant