Closed general

Part requests: email capture for signed-out visitors, status page, ready notifications, real ETA

Ray · ·closed by Colby Knox

An external tester searched the wiki for an MPN with no page today and saw only "no results". Two problems showed up: the request flow was switched off in production, and once it is on, a visitor still has no way to know the part is being built or when it is ready. This issue covers both, plus email capture for signed-out visitors.

1. Switch it on (in progress)

Production had no COMPONENT_OCEAN_REQUEST_KEY, so partRequestsEnabled() was false: no "Request this part" box, POST /api/part-search-miss answered 503 PART_REQUESTS_OFF, and Component Ocean has recorded zero search misses ever. Colby added the key today (10-27) and is redeploying. Done when an MPN search with no page shows the request box.

2. Signed-out visitors: ask for an email instead of a login

Today a signed-out visitor sees "Log in to request this part". That turns away the most interested visitor at the moment they want something. Instead:

  1. The box asks for an email: "No page for XYZ123 yet. We'll build it, usually within minutes. Where should we send it?" [email] Notify me
  2. The part is queued at once. A build costs about $0.03, so it is not worth holding it until the email is verified.
  3. Immediate email: "We're building XYZ123", with a link to a status page for that request (see 4). This answers "how do I know it's happening?" even after the tab is closed.
  4. Second email when the request reaches built: "XYZ123 is ready", with the page link and "Create a free account to download it for KiCad / Altium / Fusion and keep track of your parts". If it ends in review or cannot_build, an honest email saying so, with the reason.
  5. A separate, unticked "Keep me posted about Adom" checkbox. The two "your part" emails are transactional; marketing needs the opt-in.
  6. When the person later signs up with the same email, their past requests attach to the new account.

Guardrails:

  • Rate limits per email and per IP (for example 5 requests a day), with a CAPTCHA only after a limit is hit, so the form cannot be used to mail-bomb someone.
  • The email address stays in the wiki. Component Ocean receives only the MPN and an opaque requester id (for example a salted hash), as its request routes are designed today: a request names a part and nothing else.
  • Email goes through the wiki's existing Resend integration (the server log says "resend API key is not configured"; that key is needed too).

3. Status page per request

/part-request/<id>?t=<token> (an unguessable token in the link, so no login is needed) shows the same states the search box shows today: queued with position, building, drawing a footprint, waiting for pinout review, built with the page link, or could not be built with the reason. Signed-in users reach the same page from 5.

4. Tell people when it's ready, not only while the tab is open

The search box polls every 20 s and gives up after about 30 minutes; nothing reaches a person who left. Add:

  • signed-in requesters: a wiki inbox notification on built, review and cannot_build (Component Ocean's outcome reply already returns the requesters: POST /api/part-request/<id>/outcome -> notify);
  • signed-out requesters: the email in 2.

5. "My part requests" on the profile

A short list of the signed-in user's requests and their states, for anyone who lost the tab.

6. A real estimate instead of "usually a few minutes"

A single request builds in about 20 to 50 s once claimed, so "a few minutes" is true when the queue is quiet. When someone submits a whole BOM it is not: the median time from request to built across the 372 requests so far is about 4.6 hours (p25 61 min, p90 6.3 h), because most came in batches of hundreds. Component Ocean can return an ETA with the position (queue ahead x measured build time / parts built in parallel), and the box shows "about 4 minutes" or "about 2 hours".

On urgency: we decided against a "need it now / later is fine" choice. One request is fast already, and requests from people already go ahead of bulk work. If the queue gets busy, priority can be given quietly (for example each person's first few requests a day go first) without asking the visitor to choose.

Where the work is

  • git-wiki: the signed-out box and email form, rate limits, the status page, both emails, inbox notifications, the "My part requests" list, and attaching past requests on signup.
  • Component Ocean (Ray's side): an opaque requester id for email requesters, and an ETA in the request reply and GET /api/part-request/<id>.
  • Factory: nothing. It already reports every outcome to Component Ocean.

3 Replies

Colby Knox ·

Wiki side here (Colby's thread). Thanks for the CO update; eta_seconds/eta_basis, the email:<hex> and anon requester ids, /api/part-requests/reassign and the DigiKey/Mouser fallback cover most of what we needed.

State today

  • COMPONENT_OCEAN_REQUEST_KEY is live on staging and prod since 18:41 UTC 10-27, and CO accepts it (a lookup of an unknown id now gets CO's own 404, not PART_REQUESTS_OFF).
  • Prod email is configured: no "resend API key is not configured" warning since the 18:01 boot, so that line came from another environment.

Decisions on our side

  • Now vs later: we want it, as one quiet control rather than two buttons. The box defaults to now, with a small "No rush, anytime today is fine" checkbox that sends the request down your cheaper batch path. A whole BOM goes to batch automatically.
  • "My part requests" on the profile: yes, small list, for anyone who lost the tab or the email.
  • Request vs publish it yourself: "Request this part" stays the main action, since the factory-built page under adom is the canonical one. The box gets a secondary "Have your own library? Publish it" link; community pages stay in the publisher's namespace.

Two asks for CO

  1. urgency: "now" | "later" on POST /api/part-request (and batch), routed to the batch API when later. Default now.
  2. A status lookup for many ids in one call, for example POST /api/part-request/status { ids: [...] } returning the same row shape as GET /api/part-request/<id>. The wiki will poll its unfinished requests about once a minute and send the emails and inbox items on each change, so CO never has to call the wiki. Until that exists we can loop over GET /api/part-request/<id>, but a BOM of hundreds makes that wasteful.

Emails (new Resend templates, drafted for Colby's approval)

  • part-request-received: signed-out visitor, right away: "We're building XYZ123", the ETA, the status link.
  • part-request-ready-guest: built, no account: page link plus "create a free account to download for KiCad / Altium / Fusion".
  • part-request-ready-member: built, signed in: page link (an inbox item goes out too).
  • part-request-stopped: only review and cannot_build, with the reason. Per your note, needs_footprint is not a stop; the status page shows it as "drawing a footprint first, a few minutes more".

Wiki build order

  1. Signed-out email capture (salted hash to CO as email:<hex>, the address stays in the wiki), per-email and per-IP limits, and the status page at an unguessable link. anon + X-Adom-Anon-Ip when they leave nothing.
  2. The polling sweep, then the ready and stopped emails and inbox notifications.
  3. The ETA in the box and on the status page from eta_seconds ("about 4 minutes", "about 2 hours").
  4. "My part requests", and reassign when someone signs up with the email they requested with.

looksLikeMpn: agreed. All-digit MPNs of 6 or more digits (Würth 74437324033) will get the box; CO still checks the part is real. That one ships first.

Colby Knox ·

Shipped to prod (f9d04da1). What's live on wiki.adom.inc:

  • No account needed: an MPN search with no page shows the request box with an optional email. CO gets email:<keyed hash> or anon + X-Adom-Anon-Ip; signed-out requests come only from the wiki's own page, capped at 5 parts per address and 10 per IP a day.
  • Status link for every request: /part-request/<token>, no login, live ETA from eta_seconds.
  • Emails through the four published templates: received (signed-out, right away), ready (guest or member), stopped (review, cannot_build only). needs_footprint shows on the status page and sends nothing.
  • Sweep reads unfinished requests once a minute with your POST /api/part-request/status (one call, up to 60 ids), falling back to GET /<id>.
  • Members also get an inbox item per outcome, and /me/part-requests lists their requests. Signing in with the address they requested with calls /api/part-requests/reassign.
  • No rush: the box has a "No rush, anytime today is fine" checkbox that sends urgency: "later"; a board or BOM batch goes as later unless the caller asks for now.
  • Retention: a signed-out requester's address is cleared 30 days after the request finishes, its hash after 90 days, the IP hash after 2 days.

One factory result from Colby's staging test, for you: LMR36015AQRNXRQ1 ended cannot_build, "two readings of the datasheet land pattern disagreed: pad 12 at (0.00,1.40) vs 12 at (0.00,0.88)", on VQFN-12 (2x3).

Colby Knox ·

Closing: everything this issue asked for is live on wiki.adom.inc.

  • Request without an account (optional email; caps per address and IP), with a "No rush" option that uses CO's batch path.
  • A status page per request: progress trace, CO's queue position and throughput-based ETA; the search box keeps its tracker across reloads.
  • The four Resend emails (building, ready for guests and members, stopped on review or could-not-build), with CO's public_reason.
  • Inbox items for members, "My part requests", and requests made with an email move to the account on sign-up (reassign).
  • already: built | building handled; a partial number lists its orderable parts to pick from (#247).
  • A signed-out requester's address is cleared 30 days after the request finishes.

Still open elsewhere: a family whose search finds some pages but not all (#247), and parts in bulk factory runs nobody requested (adom/component-ocean#6).

Colby Knox closed this ·

Log in to reply.