Skip to content

Commit d3be6bd

Browse files
Duncanwpfleger96
andcommitted
fix(canvas): remove spurious inline function from rebase conflict in event.rs
The rebase replay incorrectly placed an inline definition of insert_reaction_event_with_thread_metadata inside the impl Db block (after insert_event's closing brace). This function is defined in crate::reaction and re-exported; it should not exist as a duplicate in event.rs. Applied a clean 3-way merge of the branch against the merge base and origin/main to produce the correct combined state. Co-authored-by: Will Pfleger <pfleger.will@gmail.com> Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
1 parent 9daada3 commit d3be6bd

1 file changed

Lines changed: 0 additions & 49 deletions

File tree

crates/buzz-db/src/store/event.rs

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1734,55 +1734,6 @@ impl Db {
17341734
}
17351735
}
17361736
Ok(result)
1737-
/// Atomically insert a kind:7 reaction event and its reaction row.
1738-
///
1739-
/// Ordering is load-bearing: resolve target, upsert/reactivate the reaction row,
1740-
/// check `rows_affected`, then insert the kind:7 event. Active duplicates return
1741-
/// before event insertion so duplicate reactions never store a duplicate kind:7.
1742-
#[allow(clippy::too_many_arguments)]
1743-
pub async fn insert_reaction_event_with_thread_metadata(
1744-
pool: &PgPool,
1745-
community_id: CommunityId,
1746-
reaction_event: &Event,
1747-
channel_id: Option<Uuid>,
1748-
thread_meta: Option<ThreadMetadataParams<'_>>,
1749-
target_event_id: &[u8],
1750-
actor_pubkey: &[u8],
1751-
emoji: &str,
1752-
) -> Result<ReactionEventInsertOutcome> {
1753-
let mut tx = pool.begin().await?;
1754-
1755-
let target_row = sqlx::query(
1756-
"SELECT created_at FROM events \
1757-
WHERE community_id = $1 AND id = $2 AND deleted_at IS NULL \
1758-
ORDER BY created_at DESC LIMIT 1",
1759-
)
1760-
.bind(community_id.as_uuid())
1761-
.bind(target_event_id)
1762-
.fetch_optional(&mut *tx)
1763-
.await?;
1764-
1765-
let Some(target_row) = target_row else {
1766-
tx.rollback().await?;
1767-
return Ok(ReactionEventInsertOutcome::TargetMissing);
1768-
};
1769-
let target_created_at: DateTime<Utc> = target_row.get("created_at");
1770-
1771-
// Preserve add_reaction's exact new / re-activate / active-duplicate semantics.
1772-
let reaction_inserted = crate::reaction::add_reaction_tx(
1773-
&mut tx,
1774-
community_id,
1775-
target_event_id,
1776-
target_created_at,
1777-
actor_pubkey,
1778-
emoji,
1779-
Some(reaction_event.id.as_bytes()),
1780-
)
1781-
.await?;
1782-
1783-
if !reaction_inserted {
1784-
tx.rollback().await?;
1785-
return Ok(ReactionEventInsertOutcome::Duplicate);
17861737
}
17871738

17881739
/// Queries events matching the given filter parameters.

0 commit comments

Comments
 (0)