Explore the hyperswitch codebase to find: 1. The events table schema definition 2. Where…
- User
Explore the hyperswitch codebase to find:
- The events table schema definition
- Where idempotent_event_id is generated from payment_id and event_type
- The database constraint limiting idempotent_event_id to 64 characters
Assistant
I'll help you explore the hyperswitch codebase to find information about the events table schema, idempotent_event_id generation, and the database constraint. Let me start by examining the codebase structure and searching for relevant files.
First, I'll look for the events table schema definition:
Assistant
Let me look at the diesel models for events, which are likely to contain the schema definition:
Assistant
Now let me check the database schema definition for the events table to understand the idempotent_event_id constraints:
Assistant
Let me look for the schema definitions in the migrations or database-related files:
Assistant
(no content)
Assistant
Great! I found the schema definition for the events table. Now let me look for where idempotent_event_id is generated from payment_id and event_type. Let me search for usages of this field:
Assistant
Let me examine the events database module and core webhook logic to understand how idempotent_event_id is generated:
Assistant
Now let me search for where the idempotent_event_id is actually generated from payment_id and event_type:
Assistant
Let me look at the webhook events logic to understand how idempotent_event_id is generated:
Assistant
Let me check the webhook utilities where the idempotent_event_id is generated:
Assistant
Perfect! Now I found where the
idempotent_event_idis generated. Looking at theget_idempotent_event_idfunction incrates/router/src/core/webhooks/utils.rslines 144-161:#[inline] pub(crate) fn get_idempotent_event_id( primary_object_id: &str, event_type: types::storage::enums::EventType, delivery_attempt: types::storage::enums::WebhookDeliveryAttempt, ) -> String { use crate::types::storage::enums::WebhookDeliveryAttempt; const EVENT_ID_SUFFIX_LENGTH: usize = 8; let common_prefix = format!("{primary_object_id}_{event_type}"); match delivery_attempt { WebhookDeliveryAttempt::InitialAttempt => common_prefix, WebhookDeliveryAttempt::AutomaticRetry | WebhookDeliveryAttempt::ManualRetry => { common_utils::generate_id(EVENT_ID_SUFFIX_LENGTH, &common_prefix) } } }This function generates the idempotent_event_id by:
- Creating a common prefix of for initial attempts
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.