towerops/lib
graham ce7a8d196f fix: replace Repo.rollback with proper error handling for Oban compatibility (#201)
- Replace manual Repo.rollback/1 calls with raise/return patterns
- Fix typo: Repo.transact -> Repo.transaction
- Add unwrap_transaction_result/1 helper to reduce nesting depth
- Extract helper functions to satisfy Credo nesting depth requirements
- Fixes 'operation :rollback is rolling back unexpectedly' error

When Oban Pro's Smart engine uses Ecto.Multi for nested transactions,
manual Repo.rollback/1 calls break the transaction stack. This fix uses
proper error handling patterns:

1. Raise exceptions to trigger automatic rollback (admin.ex)
2. Return error tuples and unwrap with helper function (accounts.ex, mobile_sessions.ex)

Files changed:
- lib/towerops/admin.ex (3 functions: delete_user, delete_organization, update_billing_overrides)
- lib/towerops/accounts.ex (5 functions with helpers: update_user_email, reset_user_password, update_user_and_delete_all_tokens, do_update_user_and_delete_tokens, delete_account)
- lib/towerops/mobile_sessions.ex (2 functions with helper: complete_qr_login, do_complete_qr_login)

All tests passing (277 tests total).

Reviewed-on: graham/towerops-web#201
2026-03-28 09:11:21 -05:00
..
mix/tasks Add GeoIP import HTTP tests 2026-03-10 16:02:49 -05:00
snmpkit feat: implement batched SNMP GET for multi-OID requests (#183) 2026-03-26 16:37:34 -05:00
towerops fix: replace Repo.rollback with proper error handling for Oban compatibility (#201) 2026-03-28 09:11:21 -05:00
towerops_web fix: address code review findings - memory leaks and redundant queries (#192) 2026-03-27 16:34:42 -05:00
snmp_lib.ex bring in snmpkit 2026-01-23 12:52:17 -06:00
snmp_mgr.ex credo fixes 2026-01-23 14:01:52 -06:00
snmpkit.ex complete overhaul of snmp engine 2026-01-30 10:41:07 -06:00
towerops.ex init 2025-12-21 11:10:43 -06:00
towerops_native.ex Merge remote-tracking branch 'origin/main' into feature/preseem-integration 2026-02-13 09:11:45 -06:00
towerops_web.ex i18n: wrap all user-facing strings in gettext() 2026-02-14 17:44:01 -06:00