Settings — Reset local data
import { Aside } from ‘@astrojs/starlight/components’;
When to use this page
Section titled “When to use this page”Vendor Desktop caches the product catalog + order outbox in a local SQLite database. When the cache is heavily corrupted — wrong prices, duplicate products, outbox won’t sync — you need to reset so the system re-pulls from the server.
This guide is for the store owner (requires settings write).
Source: apps/vendor-web/src/app/point-of-sale/pages/settings/settings-local-data-page.tsx + <PosLocalDataResetPanel> (apps/vendor-web/src/components/point-of-sale/pos-local-data-reset-panel.tsx).
Image: reset panel — scope radios (Catalog only / With outbox), backup hint line, red Reset button. Spec owner: cashier-screenshots.spec.ts → "settings — local data reset".
Before you start
Section titled “Before you start”- Run during off-peak hours — the reset empties the cache, so the next sale will trigger a sync (potentially slower).
- Sync the outbox first if possible — when you include the outbox in the reset, unsynced orders are deleted (a backup is still created).
- Pick an active store —
storeIdis required to reset; otherwise you’ll see the “No store” banner.
2 reset scopes
Section titled “2 reset scopes”<PosLocalDataResetPanel> offers 2 radio options:
| Scope | Deletes | Keeps | When to use |
|---|---|---|---|
Catalog only (catalog_only) | catalog_* tables in local DB | Outbox (pending orders) | Stale cache / wrong prices / duplicate products |
With outbox (with_outbox) | Catalog + entire outbox | — | Broken outbox, orders stuck in pending |
4 reset steps
Section titled “4 reset steps”Step 1 — Open the page
Section titled “Step 1 — Open the page”From the Cashier shell → Settings → Local data (/point-of-sale/settings/local-data).
Step 2 — Pick a scope
Section titled “Step 2 — Pick a scope”Tick one of the two radios. Default is Catalog only (safer).
Step 3 — Click “Reset”
Section titled “Step 3 — Click “Reset””Opens the confirmation modal <PosLocalDataResetConfirmModal> → read carefully → click Confirm.
Step 4 — Wait for the result toast
Section titled “Step 4 — Wait for the result toast”When done, the toast shows:
Reset successful. Backup: <backupVersion>;catalog rows deleted: <catalogRows>; outbox rows deleted: <outboxRows>.After that:
- Reset Zustand hydration (
resetHydration()). - Invalidate all TanStack queries.
- Bootstrap the settings cache from the server (
bootstrapPosLocalSettingsQueryCache). - Pull a fresh catalog from the server (
pullPosLocalCatalogFromServer) — best-effort; if it fails, click Sync manually.
Expected outcome
Section titled “Expected outcome”- The catalog shows the latest product list from the API.
- The current cart may be empty because the lines referenced the old catalog.
- Server drafts are untouched — only local cache is deleted.
Backup & restore
Section titled “Backup & restore”Every reset creates a backup version inside Electron’s user-data directory (resetPosLocalDataForResync returns backupVersion). The backup contains the full DB before deletion.
To restore (outside the UI scope):
- Contact support with the backup version from the toast.
- Support runs the restore script against the backup file.
Common issues
Section titled “Common issues”| Symptom | Fix |
|---|---|
| Page shows “Desktop only” | You’re on a pure browser install — only Vendor Desktop supports it |
| Page shows “Unavailable” | isVendorPosLocalDbEnabled is off (local-first flag) — contact support |
| “No store” banner | No active store selected on the top bar |
| Reset fails with an error toast | Check the server connection; try again |
| Catalog still looks old after reset | Click Sync manually in the Sale screen, or restart Vendor Desktop |
When NOT to reset
Section titled “When NOT to reset”- Peak hours — will slow down the next sale.
- Outbox has unsynced orders that you don’t want to lose — sync manually first.
- Right after a bulk price update in Dashboard — wait 5–10 minutes for cashiers to receive the automatic pull.
Technical
Section titled “Technical”- Component:
<PosLocalDataResetPanel>(pos-local-data-reset-panel.tsx) - Hook helpers:
usePosServerOnline,usePosStoreId - Services:
resetPosLocalDataForResync,pullPosLocalCatalogFromServer - Confirm modal:
<PosLocalDataResetConfirmModal>(pos-local-data-reset-confirm-modal.tsx) - Settings store:
usePosLocalSettingsStore(Zustand)