Send gateway commands after DB transaction is commited
- Dominant language
- Rust
- Stars
- 2.8k
- Forks
- 115
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 51
Description
There are several places where a gateway command (ACL update etc.) is sent within a pending DB transaction.
This means that if a transaction is rolled back, the gateway state will no longer reflect what is actually stored in the database.
We should consider making it consistent and always sending events after a successful commit.
Some affected functions:
- `sync_all_networks`
- `sync_allowed_user_devices`
- `delete_user_and_cleanup_devices`
Contributor guide
Research direction
Start by locating sync_all_networks, sync_allowed_user_devices, and delete_user_and_cleanup_devices, then inspect their database transaction boundaries and gateway command calls. Verify that gateway commands are sent only after a successful commit, with no command sent when the transaction rolls back.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- backend, databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 58/100