DefGuard / DefGuard/defguard

Send gateway commands after DB transaction is commited

Open
#3,660 0 comments 0 reactions 0 assignees View on GitHub
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.