[BUG] Symbol search returns CUSTOM_SCRAPER without provider code — quote price missing for custom-provider assets
Summary
When selecting an existing asset backed by a custom scraper provider in Add Activity → symbol search, the UI shows name and currency but no live price. Quote resolution fails because search returns providerId: "CUSTOM_SCRAPER" instead of CUSTOM:<code>.
Root cause
Custom-provider assets are stored correctly in provider_config:
{
"preferred_provider": "CUSTOM_SCRAPER",
"custom_provider_code": "moe"
}Symbol search maps existing assets via asset.preferred_provider(), which returns only "CUSTOM_SCRAPER".
Add Activity then calls resolve-currency with that value. Resolution only works when the provider id includes the custom code:
providerId |
Result |
|---|---|
CUSTOM:<code> |
price: 3729.89 |
CUSTOM_SCRAPER |
price: null |
The frontend already uses CUSTOM:<code> elsewhere (asset edit, serializeProviderConfig / parsePreferredProvider). Symbol search is the missing piece.
Scope
Affected: Any asset using a custom scraper provider (custom_provider_code set).
Not affected (as far as we know): Holdings / latest quotes — QuoteContext passes custom_provider_code separately from provider_config. Yahoo, Finnhub, etc. are unaffected.
Related surfaces to sanity-check after fix:
- Add Activity symbol search + price preview
- Any API/UI that exposes
providerIdfrompreferred_provider()alone - Catalog → create asset flow (storage format is fine; resolution wire format matters)
Proposed fix
Add a helper on Asset, e.g. symbol_resolution_provider_id():
- If
preferred_provider == "CUSTOM_SCRAPER"andcustom_provider_codeis set → returnCUSTOM:{code} - Otherwise → return
preferred_provider()
Use it in asset_to_quote_summary() (symbol search) for providerId and dataSource instead of bare preferred_provider().
Files:
crates/core/src/assets/assets_model.rs— new helpercrates/core/src/quotes/service.rs— use in search result mapping- Unit tests for custom scraper + non-custom (e.g. YAHOO)
Source: wealthfolio/wealthfolio