velxio/backend/app/api/routes
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
..
__init__.py
admin.py feat(activity): add user daily activity metrics and modal for detailed project interaction 2026-04-26 19:39:45 -03:00
auth.py feat(odoo-mail): sync partner upsert before firing async mails 2026-05-13 02:59:52 +02:00
compile.py feat(compile): stream live ESP-IDF cmake + ninja output to the console 2026-05-09 23:36:58 +02:00
compile_chip.py Add ESP32 chip demos and comprehensive tests for I2C, SPI, and UART interactions 2026-04-28 19:24:39 -03:00
iot_gateway.py feat: add ESP32 WiFi/BLE emulation with ESP-IDF compilation pipeline 2026-03-31 20:53:56 -03:00
libraries.py feat: Add library version management and uninstall functionality 2026-05-02 12:54:09 +05:30
metrics.py feat(metrics): add usage analytics dashboard with country tracking 2026-04-25 19:47:40 -03:00
projects.py feat: persist multi-board projects + add auto-save 2026-05-01 13:43:33 -03:00
simulation.py Add end-to-end tests for ESP32 I2C functionality and circuit verification 2026-05-12 16:55:15 -03:00