Skip to content

Commit 1a2ddf9

Browse files
feat(relay): private read-state accessory API (#7906)
Buzz BFF: Private read-state accessory API (`/buzz/v1`)
1 parent 46dcc01 commit 1a2ddf9

32 files changed

Lines changed: 6417 additions & 81 deletions

‎Cargo.lock‎

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎crates/buzz-db/src/lib.rs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@ pub(crate) use runtime::{
6565
pub use store::{
6666
admin_moderation, allowlist, api_token, archived_identities, artifact, channel,
6767
channel_members, community, deletion, dm, event, feed, git_repo, moderation, operator_listener,
68-
partition, product_feedback, push, reaction, read_state, relay_admin_actions, relay_invite,
69-
relay_members, relay_operators, reminder, replaceable, storage_accounting, thread,
70-
thread_window, usage, user, workflow,
68+
partition, personal_read, product_feedback, push, reaction, read_state, relay_admin_actions,
69+
relay_invite, relay_members, relay_operators, reminder, replaceable, storage_accounting,
70+
thread, thread_window, usage, user, workflow,
7171
};
7272

7373
pub use allowlist::AllowlistEntry;

‎crates/buzz-db/src/runtime/migration.rs‎

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -705,7 +705,12 @@ mod postgres_tests {
705705
let mut migrations: Vec<_> = MIGRATOR.iter().collect();
706706
migrations.sort_by_key(|migration| migration.version);
707707

708-
assert_eq!(migrations.len(), 55);
708+
assert_eq!(migrations.len(), 56);
709+
assert_eq!(migrations[55].version, 56);
710+
assert!(migrations[55]
711+
.sql
712+
.as_str()
713+
.contains("CREATE TABLE personal_read_accounts"));
709714
assert_eq!(migrations[48].version, 49);
710715
assert_eq!(migrations[49].version, 50);
711716
assert_eq!(migrations[50].version, 51);
@@ -2048,6 +2053,22 @@ mod postgres_tests {
20482053
let mut expected_fences = migration.fence_attachments.clone();
20492054
expected_fences.remove("product_feedback");
20502055
expected_fences.remove("rate_limit_violations");
2056+
let personal = surface(
2057+
MIGRATOR
2058+
.iter()
2059+
.find(|m| m.version == 56)
2060+
.expect("personal read migration")
2061+
.sql
2062+
.as_ref(),
2063+
);
2064+
for (table, definition) in personal.tables {
2065+
assert_eq!(
2066+
schema.tables.get(&table),
2067+
Some(&definition),
2068+
"personal read table {table} differs"
2069+
);
2070+
}
2071+
expected_fences.extend(personal.fence_attachments);
20512072
expected_fences.extend(["artifact_heads", "artifact_revisions"].map(str::to_owned));
20522073
assert_eq!(
20532074
expected_fences, schema.fence_attachments,

‎crates/buzz-db/src/runtime/tests/thread_window_postgres_tests.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ async fn migration_schema_thread_window_prebuild_does_not_queue_behind_writer()
311311
production_result.is_ok(),
312312
"production migrator must preserve ingestion progress: {production_result:?}"
313313
);
314-
assert_eq!(version, 55);
314+
assert_eq!(version, 56);
315315
assert_eq!(final_oid, oid, "prebuild must not be replaced");
316316
assert_eq!(count, 4, "all writer witnesses must persist");
317317
}

‎crates/buzz-db/src/store/deletion.rs‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@ pub const EXPECTED_SCOPED_TABLES: &[&str] = &[
9292
"moderation_actions",
9393
"moderation_reports",
9494
"parameterized_event_watermarks",
95+
"personal_read_accounts",
96+
"personal_read_frontiers",
9597
"pubkey_allowlist",
9698
"push_leases",
9799
"push_match_queue",
@@ -110,6 +112,8 @@ pub const EXPECTED_SCOPED_TABLES: &[&str] = &[
110112

111113
/// Foreign-key-safe child-before-parent order for the PostgreSQL purge.
112114
pub const PURGE_SCOPED_TABLES: &[&str] = &[
115+
"personal_read_frontiers",
116+
"personal_read_accounts",
113117
"workflow_approvals",
114118
"scheduled_workflow_fires",
115119
"workflow_runs",

‎crates/buzz-db/src/store/mod.rs‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ pub mod moderation;
3030
pub mod operator_listener;
3131
/// Monthly table partition management.
3232
pub mod partition;
33+
/// Private signer-owned accessory read progress.
34+
pub mod personal_read;
3335
/// Buzz product-feedback sidecar persistence.
3436
pub mod product_feedback;
3537
/// Community-scoped push lease and durable wake-outbox persistence.

0 commit comments

Comments
 (0)