velxio/backend
davidmonterocrespo24 4df7abc624 feat(odoo-mail): sync partner upsert before firing async mails
Closes the register-then-immediately-forgot race for good. Two parallel
calls to /velxio/api/send-welcome and /velxio/api/send-password-reset
were hitting Odoo's REPEATABLE-READ snapshot timing: both workers took
their snapshot BEFORE either had committed the partner row, so each
ran its own INSERT and the second blew up on the velxio_user_id
unique constraint — costing one of the two emails.

Add a new sync_partner() helper that POSTs to a new Odoo route
/velxio/api/upsert-partner (lives in velxio_subscription) which only
upserts the partner — no mail, no subscription, fast. Register and
forgot-password await this BEFORE firing the async welcome / reset
tasks. Each user's flow is sequential at the Velxio HTTP layer, so
the snapshot race disappears.

sync_partner() reuses the existing _post() error-swallowing pattern.
If Odoo is down, sync_partner returns None and the await is a no-op
— the user still registers / gets the generic 200, the welcome /
reset endpoints retain their defensive upsert as a fallback path.
2026-05-13 02:59:52 +02:00
..
app feat(odoo-mail): sync partner upsert before firing async mails 2026-05-13 02:59:52 +02:00
scripts feat: persist multi-board projects + add auto-save 2026-05-01 13:43:33 -03:00
sdk
…
tests
…
.env.example
…
Dockerfile Add comprehensive tests for Cyw43Emulator functionality and lifecycle 2026-04-29 00:21:26 -03:00
debug_qemu.py
…
mcp_server.py
…
mcp_sse_server.py
…
requirements.txt fix(install): unblock self-hosting + drop forced wokwi clones 2026-05-04 00:04:11 -03:00