Fix broken saveNewEtsyUser insert query #24

Open
opened 2026-08-20 23:30:07 -06:00 by angel · 0 comments
Owner

store.go's saveNewEtsyUser (called at the end of HandleNewAuthCode) has a CTE insert that cannot run as written:

  • missing AS after WITH new_user
  • VALUE instead of VALUES on the second insert
  • the second insert into etsy_access_tokens never selects user_id from the new_user CTE, so it can't satisfy etsy_access_tokens.user_id NOT NULL

This means the OAuth connection flow - the one piece of Etsy that's supposedly already built - fails the moment someone completes a real sign-in. There's no test coverage in domains/platforms/etsy today (see #31) that would have caught this.

Fix the query to properly thread user_id from the new_user CTE into the etsy_access_tokens insert.

`store.go`'s `saveNewEtsyUser` (called at the end of `HandleNewAuthCode`) has a CTE insert that cannot run as written: - missing `AS` after `WITH new_user` - `VALUE` instead of `VALUES` on the second insert - the second insert into `etsy_access_tokens` never selects `user_id` from the `new_user` CTE, so it can't satisfy `etsy_access_tokens.user_id NOT NULL` This means the OAuth connection flow - the one piece of Etsy that's supposedly already built - fails the moment someone completes a real sign-in. There's no test coverage in `domains/platforms/etsy` today (see #31) that would have caught this. Fix the query to properly thread `user_id` from the `new_user` CTE into the `etsy_access_tokens` insert.
angel added this to the Etsy Integration milestone 2026-08-20 23:30:07 -06:00
angel added this to the MVP project 2026-08-20 23:49:47 -06:00
Sign in to join this conversation.