The products to record; each may carry variants.
Optionalsettings: PriceHistorySettingsThe user's priceTracking settings (enabled,
maxDataPoints). Tracking is on unless explicitly disabled.
Resolves once all series have been processed.
void recordProductPrices(finalResults, appContext.userSettings);
export function recordProductPrices(
products: Product[],
settings?: PriceHistorySettings,
): Promise<void> {
const task = doRecordProductPrices(products, settings);
pendingWrites.add(task);
void task.finally(() => pendingWrites.delete(task));
return task;
}
Record the current USD price of each product (and its variants) into the price-history store. Fire-and-forget: the caller wraps this in
voidfrom the search flow, but the returned promise is also tracked internally so flushPendingPriceHistory can wait for it — the MV3 popup can be closed (destroying its JS context) the instant results are shown, before a sequential multi-series write finishes.