Skip to content

Add one-time product price-drop alerts to Bell - #50

Open
georgeatparallel wants to merge 1 commit into
mainfrom
george/bell-shopping
Open

georgeatparallel wants to merge 1 commit into
mainfrom
george/bell-shopping

Conversation

@georgeatparallel

@georgeatparallel georgeatparallel commented Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator

What shoppers can do

Text Bell something like “Let me know if the Sony WH-1000XM5 drops below £250,” or send a product link and a target price. If Bell can’t verify the exact model from the name, it asks for a merchant link. Once a watch is active, Bell schedules hourly checks for up to 30 days. Checks and notifications can be delayed when the queue is busy. When an in-stock offer first meets the target, Bell texts the observed item price and a direct merchant link. The watch then ends.

If an in-stock offer already meets the target, Bell shares it in the current conversation. Shoppers can list their watches or stop several in one text.

How it works

  • A product link pins one listing. For a product name, Parallel Shopping Search finds candidate listings at setup. Bell tracks the listings it can verify on merchant pages for the requested item, variant, and market.
  • Bell compares the public item price before separately charged tax and shipping. “Below £250” requires a price under £250. “£250 or less” includes £250.
  • Bell uses its existing scheduler and Linq channel. It saves watches and alert state in PostgreSQL so restarts and retries can reuse the same send key.

How to try it

Apply migrations 007 and 008, configure the scheduler and an allowlisted Linq test number, and set BELL_PRICE_WATCHES_ENABLED=true. Set PARALLEL_API_KEY to try product-name search. The web demo’s “Text Bell” link opens the texting flow for authenticated operators. The feature is off by default. Setup instructions

Verification

  • pnpm check passed locally with PostgreSQL and Chrome. 600 tests passed and 7 were skipped. GitHub build
  • The scheduler test verified one outbound Linq request containing the price and merchant link. Regression tests cover stopping multiple watches from one text, replaying saved outcomes after migration 008, pasted links, worker lease recovery, and unconfirmed delivery. Live phone receipt still needs a configured Linq test line.
  • This PR also updates Next.js from 16.4.3 to 16.4.6 because the original version stopped the production build.

@socket-security

socket-security Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatednext@​16.4.3 ⏵ 16.4.663 +1100 +2190 +19970
Addedparse5@​8.1.11001008892100

View full report

@georgeatparallel georgeatparallel changed the title Add product price watches to Bell Add one-time product price-drop alerts to Bell Nov 24, 2026
@georgeatparallel
georgeatparallel force-pushed the george/bell-shopping branch 5 times, most recently from 5eaa18d to 3678dfb Compare November 24, 2026 01:12
@georgeatparallel
georgeatparallel marked this pull request as ready for review November 24, 2026 01:16
@georgeatparallel
georgeatparallel requested a review from a team as a code owner November 24, 2026 01:16
Comment thread server/shopping/store.ts Outdated

export async function rememberAction(db: Queryable, inbound: Inbound, name: "enroll" | "stop", request: unknown) {
await db.query(`INSERT INTO bell_price_actions(issuer,owner_id,chat,line,message_id,action,request)
VALUES ($1,$2,$3,$4,$5,$6,$7) ON CONFLICT DO NOTHING`, [...actionKey(inbound), name, request]);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right now, “stop both watches” stops the first watch, then returns that same result for the second call. the second watch stays active and can still send alerts.

perhaps we can add an operation key to bell_price_actions? smt like:

  • for stop, use the target watch ID.
  • for enroll, use a stable hash of the normalized watch request.

we could then include that key in the primary key plus all action inserts, lookups, and outcome updates (while keeping the existing owner/chat/message fields so retries of the same operation still reuse the saved result)

Use Parallel Shopping Search to find listings for named products. Verify merchant offers and send one Linq alert when a watched listing meets the target.

Update Next.js to 16.4.6 for the production build.
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.

2 participants