The Go lambda routing detail-type: "gen:interaction:event" payloads to Kinesis keeps bypassing the drop logic, since partition key generation uses hash := crypto.SHA256.Sum256([]byte(attrs["conversationId"])) before hitting kinesis.New(sess).PutRecord(&kinesis.PutRecordInput{StreamName: &streamName, PartitionKey: aws.String(fmt.Sprintf("%x", hash))}). I’m calling filterAttributes() on the unmarshaled event.Attributes map, checking attrs["channel"] == "webchat" && attrs["status"] != "closed", but the subscription still pushes everything downstream and log.Printf("dropped: %v", event.Id) never triggers even when status reads closed. Weird how the map lookup keeps skipping the negation operator while the arn:aws:events:us-east-1:... rule routes straight to lambda:InvokeFunction, so the boolean chain just evaluates to true every single time and I don’t know why the short-circuit logic isn’t catching the closed sessions.
pk := attrs["conversationId"]
if pk == "" { pk = attrs["interactionId"] }
hash := fmt.Sprintf("%x", crypto.SHA256.Sum256([]byte(pk)))
The PARTITION_KEY breaks. INTERACTION_SCHEMA drops the conversationId too early. You call filterAttributes before the hash runs. That kills the WEM sync. Just move the drop logic after the Kinesis put. WEM_SETTINGS requires a strict PARTITION_KEY format. If you hash an empty string, the stream rejects it.
Change the routing flow to this:
hash := getPartitionKey(event.Attributes)
_, err := kinesis.New(sess).PutRecord(&kinesis.PutRecordInput{
StreamName: &streamName,
PartitionKey: aws.String(hash),
})
filterAttributes(event.Attributes)
Keeps the adherence tracking intact. You’ll see fewer 400s on the WEM side once the key stabilizes. Also verify the EventBridge rule targets /api/v2/interactions/events with interaction:event:read scope. If you pull this via platformClient, the schema stays intact. Just patch the flow and restart the lambda. Logs will show the shift immediately.
id := attrs["conversationId"]
if id == nil { id = attrs["interactionId"] }
PureCloudPlatformClientV2 strips conversationId before the hash runs. Tried a nil check. Failed. Moved the filter. Payloads still drop. Doesn’t the schema version match the webhook definition?
func extractPartitionKey(attrs map[string]string) string {
id := attrs["conversationId"]
if id == "" { id = attrs["interactionId"] }
hash := crypto.SHA256.Sum256([]byte(id))
return fmt.Sprintf("%x", hash)
}
The order of operations breaks the partition key. Running the filter before the hash strips the identifier you actually need. Config promotion pipelines tend to drag those strict attribute filters over from prod anyway. Doesn’t play nice with the dev environment schema. Check if the staging org has the interaction event toggle set differently. That recent community post about topic detection toggles showed how feature flags silently drop fields during export. It’s usually the environment strategy causing the mismatch.
Are you pulling the webhook config directly from production, or is this a fresh staging clone? The hash calculation needs to run before any attribute sanitization touches the map. Moving it up stops the Kinesis rejection. Just verify the fallback handles empty strings correctly.