Skip to content

Commit

Permalink
Do not allow overriding an intent that is already published (#1416)
Browse files Browse the repository at this point in the history
* log payload hash after successfully saving commit

* hex encode payload slice before logging

* do not allow overriding an intent that is already published

* remove extra log and format

---------

Co-authored-by: cameronvoell <cameronvoell@users.noreply.github.com>
  • Loading branch information
cameronvoell and cameronvoell authored Dec 16, 2024
1 parent 25758b4 commit 339483f
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions xmtp_mls/src/storage/encrypted_store/group_intent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,11 +202,7 @@ impl DbConnection {
.filter(dsl::id.eq(intent_id))
// State machine requires that the only valid state transition to Published is from
// ToPublish
.filter(
dsl::state
.eq(IntentState::ToPublish)
.or(dsl::state.eq(IntentState::Published)),
)
.filter(dsl::state.eq(IntentState::ToPublish))
.set((
dsl::state.eq(IntentState::Published),
dsl::payload_hash.eq(payload_hash),
Expand Down

0 comments on commit 339483f

Please sign in to comment.