fix: respect activity_type in set_relay_status and include activate_relay #14

Merged
hodlbod merged 1 commits from userAdityaa/caravel:activity-logging into master 2026-04-15 20:39:06 +00:00
Contributor

PR Description

Problem

Relay status helper was hardcoding deactivate_relay when inserting activity rows, causing two correlated bugs:

  1. Activity Semantics Corruption: Calling activate_relay would update the relay to active status but log the activity as deactivate_relay, confusing the audit trail and activity feed.

  2. Missing Infra Sync for Activations: Infra sync triggers only matched on create_relay, update_relay, and deactivate_relay activities, so activation events never triggered synchronization to the zooid instance. This meant relay reactivations (e.g., after payment) would not update the remote relay state.

Root Cause

The set_relay_status helper was ignoring its activity_type parameter and always calling:

Self::insert_activity(&mut tx, "deactivate_relay", "relay", &relay_id).await?;

closes #13

### PR Description ### Problem Relay status helper was hardcoding `deactivate_relay` when inserting activity rows, causing two correlated bugs: 1. **Activity Semantics Corruption**: Calling `activate_relay` would update the relay to `active` status but log the activity as `deactivate_relay`, confusing the audit trail and activity feed. 2. **Missing Infra Sync for Activations**: Infra sync triggers only matched on `create_relay`, `update_relay`, and `deactivate_relay` activities, so activation events never triggered synchronization to the zooid instance. This meant relay reactivations (e.g., after payment) would not update the remote relay state. ### Root Cause The `set_relay_status` helper was ignoring its `activity_type` parameter and always calling: ```rust Self::insert_activity(&mut tx, "deactivate_relay", "relay", &relay_id).await?; ``` closes #13
userAdityaa added 1 commit 2026-04-15 09:49:35 +00:00
userAdityaa force-pushed activity-logging from 2d7c969113 to 62dde4b2ac 2026-04-15 09:49:35 +00:00 Compare
Author
Contributor

Tested and ready to be merged.

Tested and ready to be merged.
hodlbod merged commit 85d37f53ce into master 2026-04-15 20:39:06 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: coracle/caravel#14