ChemPal Documentation - v1.6.0
    Preparing search index...

    Function getAllSupplierProductDataCacheEntries

    • Read every entry in the supplier product-detail cache — the enriched per-product data keyed by product identity. Intended for manual inspection from the debug console; each record carries its cacheKey, the cached data, and its last-access timestamp. Returns [] on failure.

      Returns Promise<
          { cacheKey: string; data: Record<string, unknown>; timestamp: number }[],
      >

      All stored product-detail records, or [] when the read fails.

      const entries = await getAllSupplierProductDataCacheEntries();
      entries.length; // => number of cached product-detail rows
      export async function getAllSupplierProductDataCacheEntries(): Promise<
      Array<{ cacheKey: string; data: Record<string, unknown>; timestamp: number }>
      > {
      try {
      const db = await getDB();
      return await db.getAll(IDB_STORE.SUPPLIER_PRODUCT_DATA_CACHE);
      } catch (error) {
      logger.error('Failed to get all supplier product data cache entries from IndexedDB', { error });
      return [];
      }
      }