mirror of
https://github.com/block/buzz.git
synced 2026-10-30 05:51:46 +00:00
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:
@@ -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]
|
||||
|
||||
@@ -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}"
|
||||
|
||||
@@ -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 (
|
||||
|
||||
Reference in New Issue
Block a user