fix(push): align fresh database message matching

Signed-off-by: Tom Brow <tomb@block.xyz>
Co-authored-by: Codex <noreply@openai.com>
Ai-assisted: true
This commit is contained in:
Tom Brow
2026-08-21 21:20:57 -07:00
parent 7bdefdf7a6
commit daeb59877b
3 changed files with 6 additions and 2 deletions

View File

@@ -1115,6 +1115,10 @@ mod tests {
assert!(sql.contains("CREATE OR REPLACE FUNCTION enqueue_push_match_job"));
assert!(sql.contains("NEW.kind IN (9, 40002, 45001, 45003)"));
assert!(!sql.contains("NEW.kind IN (7, 9, 1059, 40007, 46010)"));
let desired_schema = include_str!("../../../schema/schema.sql");
assert!(desired_schema.contains("NEW.kind IN (9, 40002, 45001, 45003)"));
assert!(!desired_schema.contains("NEW.kind IN (7, 9, 1059, 40007, 46010)"));
}
#[test]

View File

@@ -709,7 +709,7 @@ mod tests {
.collect::<Vec<_>>()
.join(", ");
let predicate = format!("NEW.kind IN ({kinds})");
let migration = include_str!("../../../../migrations/0032_push_message_kinds.sql");
let migration = include_str!("../../../../migrations/0033_push_message_kinds.sql");
assert!(
migration.contains(&predicate),
"migration trigger must use PUSH_KINDS exactly: {predicate}"

View File

@@ -920,7 +920,7 @@ BEGIN
-- Keep this allowlist identical to the relay's validated NIP-PL descriptor.
-- Centralizing it on the events table covers every durable producer,
-- including internal paths that bypass live dispatch.
IF NEW.kind IN (7, 9, 1059, 40007, 46010) THEN
IF NEW.kind IN (9, 40002, 45001, 45003) THEN
PERFORM pg_advisory_xact_lock_shared(
hashtextextended('buzz_push_gate:' || NEW.community_id::text, 0));
IF EXISTS (