Skip to content

Deploy guardrails, rules fixes and a privacy policy that matches 2.1 - #1

Open
EnesYilmazcode wants to merge 23 commits into
mainfrom
rebuild/p0-site
Open

EnesYilmazcode wants to merge 23 commits into
mainfrom
rebuild/p0-site

Conversation

@EnesYilmazcode

@EnesYilmazcode EnesYilmazcode commented Sep 24, 2026 •

Copy link
Copy Markdown
Owner

Stack, merge in order: #1 (this one) > #2.
The extension stack: EnesYilmazcode/AmazonSellerScraper#5, EnesYilmazcode/AmazonSellerScraper#6, EnesYilmazcode/AmazonSellerScraper#7, EnesYilmazcode/AmazonSellerScraper#8, EnesYilmazcode/AmazonSellerScraper#9.

First of two stacked PRs from the rebuild audit.

Production was serving a June 11 build, and nothing in the repo deployed rules or indexes (F-40, F-41). npm run deploy now refuses a dirty tree, any branch other than main, or a main that is not origin/main, and deploys hosting, rules and indexes together. Every build is stamped with its commit in /version.json and in the sidebar.

Other fixes:

  • Emulator wiring is gated on a build flag (F-83).
  • Firestore errors show up in the dashboard instead of an empty board (F-42).
  • A missing asset returns 404 instead of index.html with a one-year cache (F-43).
  • Lead notes on untriaged products are no longer rejected by the rules (F-44). The new test failed 3 checks on the old rules.
  • The board says when it is a capped window, and columns nothing writes are hidden (F-45 label only, F-25).
  • If the workspace setup fails, the error screen offers Sign out as well as Retry.
  • The emulator runner takes its ports from EMU_*_PORT, and on exit it only kills listeners on ports that were free when it started. It never touches emulators another checkout is running.

The privacy policy, terms and landing page are rewritten to match extension 2.1 (F-91, F-93, F-95). The Gemini section lists everything 2.1's chat sends, including the scan source and the last few chat turns. The old page promised 30 and 400 day retention that nothing implemented.

Tested: npm test passes on Windows. That covers typecheck, build, the bundle check, and the rules tests on demo-proscan (28/28 sync, plus the lead and count tests). test:hosting passed 13/13 in WSL. It skips on Windows because the hosting emulator there breaks path matching. The 404 rewrite has never run against production, so curl /dashboard/assets/nope.js after the first deploy.

Does not change permissions. This repo has no manifest.json, so there is nothing for the lock to check.

…flag

The flag is inlined by Vite, so a production-shaped bundle can be built
against the emulators and dev can opt out. Emulator ports come from
VITE_AUTH_EMULATOR_PORT and VITE_FIRESTORE_EMULATOR_PORT.
scripts/emulators.mjs writes a temporary firebase config with the
requested ports and runs start or exec against demo-proscan. The QA
scripts read the emulator hosts from the environment instead of
hardcoding 8080 and 9099. Adds npm run test:rules.
The Firestore emulator's java.exe survives firebase exiting on Windows
and holds its port, which breaks the next run.
The drawer shows 'new' by default but never writes it, so the rule's
lead.stage check rejected the first note on every untriaged product.
Treat a missing stage as 'new' and require lead to be a map. Adds
scripts/qa-lead-rules.mjs to npm run test:rules (F-44).
Listener and read failures are now logged in every build, not only in
dev. Board, runs, watchlist and drawer failures show the error code and
message, with the console link when an index is missing. A failed
workspace bootstrap blocks with a retry screen instead of loading an
app that cannot read. Watchlist, nickname, lead note and export write
failures raise a toast (F-42).
The board listens to the first 100, 300 or 500 rows and used to show
that as the product count. When the window is full the header now reads
"Showing the first 300 of 1,234 products", with the total from
getCountFromServer, or "more not loaded" if the count fails. Movers
scoped to a source says it filters the global top 100. Adds a rules
test for the count queries (F-45).
Rank, Spread and Max Buy on the board, the Max Buy verdict in the
drawer and Catalog on the watchlist are always empty for real users,
because the extension's sync never writes those fields. Show them only
once a loaded row carries the data, so the seed fixture and Phase 5
bring them back without a code change (F-25).
The /dashboard/** rewrite answered a request for an old chunk hash with
index.html, and the assets header cached that for a year. The rewrite
now only matches dotless paths, so a missing asset is a real 404. HTML
and app routes are served no-cache. The router gets an errorElement and
a stale chunk triggers one guarded reload. Adds npm run test:hosting,
which runs on Linux because the Windows hosting emulator mangles paths
(F-43).
Both builds inject a proscan-build meta tag and the landing build writes
/version.json with the full sha, a dirty flag and the build time. The
dashboard shows the short sha in the sidebar footer. build now cleans
dist/ first, and build:landing no longer empties dist/ on its own, so
running it alone can't delete the dashboard (F-40).
npm run deploy used to ship hosting only, so rules and composite index
changes never reached production. It now deploys hosting,
firestore:rules and firestore:indexes to proscanbot in one step, refuses
a dirty tree or a branch other than main, and checks the bundle first:
version.json carries a real sha and the prod bundle has no emulator
wiring. Adds npm test (F-41).
On every PR and push to main: npm ci, typecheck, build, the production
bundle check, the rules tests and the hosting test against the
emulators, and a VITE_USE_EMULATOR build check. firebase-tools is pinned
to 15.8.0 (F-40, F-83).
A board with exactly 300 products filled the window and read "more not loaded" even after the count came back 300.
Say that scans paginate and fetch offer pages with the user's Amazon
session, that AI chat sends the question and scanned products to Gemini
under the user's own key, and that sync is off in 2.1. Drop the 30 and
400 day retention promises, which nothing enforces, and name the
processors.
Describe what the extension does today: paged scans of search and
storefront results, opportunity scores, exports and bring-your-own-key
chat. Show an amazon.com address in the mockup, add a meta
description, and point the logo at / so clicking it no longer throws.
Before this, a run that lost a port race force-killed whoever already
held the port, including another checkout's emulators.
The 2.1 chat request also carries the search keyword or storefront ID,
product counts, and the last six turns of the conversation.
The Sidebar's sign out isn't mounted there, so a rejected bootstrap
write left Retry as the only way out.
A clean but stale local main passed the guard and would have pushed
older hosting and rules over production.
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