Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.
TypeScript agentaiai-agentsall-in-onecrmcrm-systememaillinearmcpmessagingnotesnotionofficerustslackslack-alternativestartupstartup-toolstypescriptworkspace
perf(search): index-only per-type accessible-items queries (#4863)
gbirman2404a5e7cca1
diff --git a/.sqlx/query-09467ab0f1282fa21cdbc66fb01b7ab90a55d8b528699b9a88ce869dd45e4a66.json b/.sqlx/query-09467ab0f1282fa21cdbc66fb01b7ab90a55d8b528699b9a88ce869dd45e4a66.jsonnew file mode 100644index 0000000000..4cb61c05aa--- /dev/null+++ b/.sqlx/query-09467ab0f1282fa21cdbc66fb01b7ab90a55d8b528699b9a88ce869dd45e4a66.json@@ -0,0 +1,23 @@+{+ "db_name": "PostgreSQL",+ "query": "\n WITH user_source_ids AS (\n SELECT cp.channel_id::text as source_id FROM comms_channel_participants cp\n WHERE cp.user_id = $1 AND cp.left_at IS NULL\n UNION ALL\n SELECT t.team_id::text FROM team_user t\n WHERE t.user_id = $1\n UNION ALL\n SELECT $1\n )\n SELECT DISTINCT ea.entity_id::text as \"item_id!\"\n FROM entity_access ea\n JOIN user_source_ids us ON us.source_id = ea.source_id\n JOIN \"Chat\" c ON c.id = ea.entity_id::text\n WHERE ea.entity_type = 'chat'\n AND c.\"deletedAt\" IS NULL\n AND (NOT $2 OR c.\"userId\" != $1)\n ",+ "describe": {+ "columns": [+ {+ "ordinal": 0,+ "name": "item_id!",+ "type_info": "Text"+ }+ ],+ "parameters": {+ "Left": [+ "Text",+ "Bool"+ ]+ },+ "nullable": [+ null+ ]+ },+ "hash": "09467ab0f1282fa21cdbc66fb01b7ab90a55d8b528699b9a88ce869dd45e4a66"+}diff --git a/.sqlx/query-5c110b698a00004a548556064f3ec7f96170613378e2fc37f78f2585a26f91f0.json b/.sqlx/query-5c110b698a00004a548556064f3ec7f96170613378e2fc37f78f2585a26f91f0.jsondeleted file mode 100644index ab05ec9386..0000000000--- a/.sqlx/query-5c110b698a00004a548556064f3ec7f96170613378e2fc37f78f2585a26f91f0.json+++ /dev/null@@ -1,30 +0,0 @@-{- "db_name": "PostgreSQL",- "query": "\n WITH user_source_ids AS (\n SELECT cp.channel_id::text as source_id FROM comms_channel_participants cp\n WHERE cp.user_id = $1 AND cp.left_at IS NULL\n UNION ALL\n SELECT t.team_id::text FROM team_user t\n WHERE t.user_id = $1\n UNION ALL\n SELECT $1\n ),\n -- Get all entities the user has access to via entity_access\n UserAccessibleEntities AS (\n SELECT DISTINCT\n ea.entity_id,\n ea.entity_type\n FROM entity_access ea\n WHERE ea.source_id = ANY(SELECT source_id FROM user_source_ids)\n AND ($2::text IS NULL OR ea.entity_type = $2)\n ),\n -- Filter out deleted items and optionally exclude owned\n FilteredItems AS (\n SELECT uae.entity_id::text as item_id, uae.entity_type as item_type\n FROM UserAccessibleEntities uae\n LEFT JOIN \"Document\" d ON uae.entity_type = 'document' AND uae.entity_id::text = d.id\n LEFT JOIN \"Chat\" c ON uae.entity_type = 'chat' AND uae.entity_id::text = c.id\n LEFT JOIN \"Project\" p ON uae.entity_type = 'project' AND uae.entity_id::text = p.id\n WHERE\n (uae.entity_type = 'document' AND d.\"deletedAt\" IS NULL\n AND ($3 = false OR d.owner != $1)) OR\n (uae.entity_type = 'chat' AND c.\"deletedAt\" IS NULL\n AND ($3 = false OR c.\"userId\" != $1)) OR\n (uae.entity_type = 'project' AND p.\"deletedAt\" IS NULL\n AND ($3 = false OR p.\"userId\" != $1))\n )\n SELECT item_id as \"item_id!\", item_type as \"item_type!\" FROM FilteredItems\n ",- "describe": {- "columns": [- {- "ordinal": 0,- "name": "item_id!",- "type_info": "Text"- },- {- "ordinal": 1,- "name": "item_type!",- "type_info": "Text"- }- ],- "parameters": {- "Left": [- "Text",- "Text",- "Bool"- ]- },- "nullable": [- null,- false- ]- },- "hash": "5c110b698a00004a548556064f3ec7f96170613378e2fc37f78f2585a26f91f0"-}diff --git a/.sqlx/query-a5ce3e2825e32372811a8536ddac2e8a45e3ed323cebff87e9df0ecad67f3256.json b/.sqlx/query-a5ce3e2825e32372811a8536ddac2e8a45e3ed323cebff87e9df0ecad67f3256.jsonnew file mode 100644index 0000000000..85b240cea3--- /dev/null+++ b/.sqlx/query-a5ce3e2825e32372811a8536ddac2e8a45e3ed323cebff87e9df0ecad67f3256.json@@ -0,0 +1,23 @@+{+ "db_name": "PostgreSQL",+ "query": "\n WITH user_source_ids AS (\n SELECT cp.channel_id::text as source_id FROM comms_channel_participants cp\n WHERE cp.user_id = $1 AND cp.left_at IS NULL\n UNION ALL\n SELECT t.team_id::text FROM team_user t\n WHERE t.user_id = $1\n UNION ALL\n SELECT $1\n )\n SELECT DISTINCT ea.entity_id::text as \"item_id!\"\n FROM entity_access ea\n JOIN user_source_ids us ON us.source_id = ea.source_id\n JOIN \"Document\" d ON d.id = ea.entity_id::text\n WHERE ea.entity_type = 'document'\n AND d.\"deletedAt\" IS NULL\n AND (NOT $2 OR d.owner != $1)\n ",+ "describe": {+ "columns": [+ {+ "ordinal": 0,+ "name": "item_id!",+ "type_info": "Text"+ }+ ],+ "parameters": {+ "Left": [+ "Text",+ "Bool"+ ]+ },+ "nullable": [+ null+ ]+ },+ "hash": "a5ce3e2825e32372811a8536ddac2e8a45e3ed323cebff87e9df0ecad67f3256"+}diff --git a/.sqlx/query-b48f3da320797f3254c2f0e88442261ba53a69dfaa2ba97e4ba581fe6098e52c.json b/.sqlx/query-b48f3da320797f3254c2f0e88442261ba53a69dfaa2ba97e4ba581fe6098e52c.jsonnew file mode 100644index 0000000000..7d62b4ae05--- /dev/null+++ b/.sqlx/query-b48f3da320797f3254c2f0e88442261ba53a69dfaa2ba97e4ba581fe6098e52c.json@@ -0,0 +1,23 @@+{+ "db_name": "PostgreSQL",+ "query": "\n WITH user_source_ids AS (\n SELECT cp.channel_id::text as source_id FROM comms_channel_participants cp\n WHERE cp.user_id = $1 AND cp.left_at IS NULL\n UNION ALL\n SELECT t.team_id::text FROM team_user t\n WHERE t.user_id = $1\n UNION ALL\n SELECT $1\n )\n SELECT DISTINCT ea.entity_id::text as \"item_id!\"\n FROM entity_access ea\n JOIN user_source_ids us ON us.source_id = ea.source_id\n JOIN \"Project\" p ON p.id = ea.entity_id::text\n WHERE ea.entity_type = 'project'\n AND p.\"deletedAt\" IS NULL\n AND (NOT $2 OR p.\"userId\" != $1)\n ",+ "describe": {+ "columns": [+ {+ "ordinal": 0,+ "name": "item_id!",+ "type_info": "Text"+ }+ ],+ "parameters": {+ "Left": [+ "Text",+ "Bool"+ ]+ },+ "nullable": [+ null+ ]+ },+ "hash": "b48f3da320797f3254c2f0e88442261ba53a69dfaa2ba97e4ba581fe6098e52c"+}diff --git a/crates/macro_db_client/fixtures/get_user_accessible_items_explicit.sql b/crates/macro_db_client/fixtures/get_user_accessible_items_explicit.sqlindex ff26ffeb21..b3f0d28b16 100644--- a/crates/macro_db_client/fixtures/get_user_accessible_items_explicit.sql+++ b/crates/macro_db_client/fixtures/get_user_accessible_items_explicit.sql@@ -58,4 +58,14 @@ VALUES ('a0000000-0000-0000-0000-0000000e0004'::uuid, 'project', 'user-1', 'user('a0000000-0000-0000-0000-0000000e0005'::uuid, 'chat', 'user-1', 'user', 'view'),('a0000000-0000-0000-0000-0000000e0006'::uuid, 'document', 'user-1', 'user', 'view');+-- A soft-deleted document shared with user-1: must never be returned+INSERT INTO public."Document" ("id", "name", "owner", "deletedAt")+VALUES ('a0000000-0000-0000-0000-0000000e0008', 'Deleted Shared Document', 'user-2', NOW());+INSERT INTO public.entity_access ("entity_id", "entity_type", "source_id", "source_type", "access_level")+VALUES ('a0000000-0000-0000-0000-0000000e0008'::uuid, 'document', 'user-1', 'user', 'view');++-- A grant whose document row no longer exists: must never be returned+INSERT INTO public.entity_access ("entity_id", "entity_type", "source_id", "source_type", "access_level")+VALUES ('a0000000-0000-0000-0000-0000000e0009'::uuid, 'document', 'user-1', 'user', 'view');+SET session_replication_role = 'origin';diff --git a/crates/macro_db_client/migrations/20260715154137_add_entity_access_source_type_entity_plain_index.sql b/crates/macro_db_client/migrations/20260715154137_add_entity_access_source_type_entity_plain_index.sqlnew file mode 100644index 0000000000..62780b4afc--- /dev/null+++ b/crates/macro_db_client/migrations/20260715154137_add_entity_access_source_type_entity_plain_index.sql@@ -0,0 +1,21 @@+-- no-transaction+-- Plain-column source-first index for the accessible-items path.+--+-- idx_entity_access_source_type_entity keys its third column on the+-- expression (entity_id::text). Postgres never uses expression entries to+-- satisfy a reference to the underlying column, so any query that reads+-- ea.entity_id is disqualified from an index-only scan on that index and+-- pays a heap fetch per grant row. Keying entity_id as a plain column keeps+-- the (source_id, entity_type) range scan index-only; callers cast the uuid+-- after the read.+--+-- NOTE: if the concurrent build is interrupted mid-deploy it can leave an+-- INVALID index behind, and the IF NOT EXISTS rerun will not rebuild it+-- (this migration must stay a single statement — sqlx sends no-transaction+-- migrations as one simple-query batch, and a multi-statement batch gets an+-- implicit transaction, which CONCURRENTLY forbids). If that happens, fix by+-- hand: DROP INDEX CONCURRENTLY idx_entity_access_source_type_entity_plain;+-- then re-run migrations. Check with:+-- SELECT indexrelid::regclass FROM pg_index WHERE NOT indisvalid;+CREATE INDEX CONCURRENTLY IF NOT EXISTS idx_entity_access_source_type_entity_plain+ ON entity_access (source_id, entity_type, entity_id);diff --git a/crates/macro_db_client/migrations/20260715154212_add_document_live_id_owner_index.sql b/crates/macro_db_client/migrations/20260715154212_add_document_live_id_owner_index.sqlnew file mode 100644index 0000000000..4fe82efe0f--- /dev/null+++ b/crates/macro_db_client/migrations/20260715154212_add_document_live_id_owner_index.sql@@ -0,0 +1,10 @@+-- no-transaction+-- Covering partial index so the accessible-items query can verify that a+-- granted document still exists, is not soft-deleted, and (optionally) is+-- not owned by the caller without touching the Document heap. Partial on+-- live rows keeps it small enough to stay cached.+--+-- Single statement on purpose: see the note in+-- 20260715154137_add_entity_access_source_type_entity_plain_index.sql.+CREATE INDEX CONCURRENTLY IF NOT EXISTS idx_document_live_id_owner+ ON "Document" (id) INCLUDE (owner) WHERE "deletedAt" IS NULL;diff --git a/crates/macro_db_client/migrations/20260715154213_add_chat_live_id_user_index.sql b/crates/macro_db_client/migrations/20260715154213_add_chat_live_id_user_index.sqlnew file mode 100644index 0000000000..b8382b379b--- /dev/null+++ b/crates/macro_db_client/migrations/20260715154213_add_chat_live_id_user_index.sql@@ -0,0 +1,8 @@+-- no-transaction+-- Chat counterpart of idx_document_live_id_owner: index-only liveness and+-- owner check for the accessible-items query.+--+-- Single statement on purpose: see the note in+-- 20260715154137_add_entity_access_source_type_entity_plain_index.sql.+CREATE INDEX CONCURRENTLY IF NOT EXISTS idx_chat_live_id_user+ ON "Chat" (id) INCLUDE ("userId") WHERE "deletedAt" IS NULL;diff --git a/crates/macro_db_client/migrations/20260715154214_add_project_live_id_user_index.sql b/crates/macro_db_client/migrations/20260715154214_add_project_live_id_user_index.sqlnew file mode 100644index 0000000000..041483d816--- /dev/null+++ b/crates/macro_db_client/migrations/20260715154214_add_project_live_id_user_index.sql@@ -0,0 +1,8 @@+-- no-transaction+-- Project counterpart of idx_document_live_id_owner: index-only liveness and+-- owner check for the accessible-items query.+--+-- Single statement on purpose: see the note in+-- 20260715154137_add_entity_access_source_type_entity_plain_index.sql.+CREATE INDEX CONCURRENTLY IF NOT EXISTS idx_project_live_id_user+ ON "Project" (id) INCLUDE ("userId") WHERE "deletedAt" IS NULL;diff --git a/crates/macro_db_client/src/item_access/get_accessible_items.rs b/crates/macro_db_client/src/item_access/get_accessible_items.rsindex b70f23f42a..806c784f49 100644--- a/crates/macro_db_client/src/item_access/get_accessible_items.rs+++ b/crates/macro_db_client/src/item_access/get_accessible_items.rs@@ -5,7 +5,8 @@ use model::item::UserAccessibleItem;use sqlx::{Pool, Postgres};/// Gets all accessible items for a user by querying entity_access with the user's source IDs-/// (user ID, team memberships, and channel participations).+/// (user ID, team memberships, and channel participations). Soft-deleted items and grants+/// whose item row no longer exists are excluded.#[tracing::instrument(skip(db))]#[cfg_attr(not(test),@@ -22,7 +23,101 @@ pub async fn get_user_accessible_items(item_type_filter: Option<String>,exclude_owned: bool,) -> anyhow::Result<Vec<UserAccessibleItem>> {- let results = sqlx::query!(+ match item_type_filter.as_deref() {+ Some("document") => accessible_documents(db, user_id, exclude_owned).await,+ Some("chat") => accessible_chats(db, user_id, exclude_owned).await,+ Some("project") => accessible_projects(db, user_id, exclude_owned).await,+ Some(_) => Ok(vec![]),+ None => {+ let mut items = accessible_documents(db, user_id, exclude_owned).await?;+ items.extend(accessible_chats(db, user_id, exclude_owned).await?);+ items.extend(accessible_projects(db, user_id, exclude_owned).await?);+ Ok(items)+ }+ }+}++fn to_items(ids: Vec<String>, item_type: &str) -> Vec<UserAccessibleItem> {+ ids.into_iter()+ .map(|item_id| UserAccessibleItem {+ item_id,+ item_type: item_type.to_string(),+ })+ .collect()+}++async fn accessible_documents(+ db: &Pool<Postgres>,+ user_id: &str,+ exclude_owned: bool,+) -> anyhow::Result<Vec<UserAccessibleItem>> {+ let ids = sqlx::query_scalar!(+ r#"+ WITH user_source_ids AS (+ SELECT cp.channel_id::text as source_id FROM comms_channel_participants cp+ WHERE cp.user_id = $1 AND cp.left_at IS NULL+ UNION ALL+ SELECT t.team_id::text FROM team_user t+ WHERE t.user_id = $1+ UNION ALL+ SELECT $1+ )+ SELECT DISTINCT ea.entity_id::text as "item_id!"+ FROM entity_access ea+ JOIN user_source_ids us ON us.source_id = ea.source_id+ JOIN "Document" d ON d.id = ea.entity_id::text+ WHERE ea.entity_type = 'document'+ AND d."deletedAt" IS NULL+ AND (NOT $2 OR d.owner != $1)+ "#,+ user_id,+ exclude_owned+ )+ .fetch_all(db)+ .await?;++ Ok(to_items(ids, "document"))+}++async fn accessible_chats(+ db: &Pool<Postgres>,+ user_id: &str,+ exclude_owned: bool,+) -> anyhow::Result<Vec<UserAccessibleItem>> {+ let ids = sqlx::query_scalar!(+ r#"+ WITH user_source_ids AS (+ SELECT cp.channel_id::text as source_id FROM comms_channel_participants cp+ WHERE cp.user_id = $1 AND cp.left_at IS NULL+ UNION ALL+ SELECT t.team_id::text FROM team_user t+ WHERE t.user_id = $1+ UNION ALL+ SELECT $1+ )+ SELECT DISTINCT ea.entity_id::text as "item_id!"+ FROM entity_access ea+ JOIN user_source_ids us ON us.source_id = ea.source_id+ JOIN "Chat" c ON c.id = ea.entity_id::text+ WHERE ea.entity_type = 'chat'+ AND c."deletedAt" IS NULL+ AND (NOT $2 OR c."userId" != $1)+ "#,+ user_id,+ exclude_owned+ )+ .fetch_all(db)+ .await?;++ Ok(to_items(ids, "chat"))+}++async fn accessible_projects(+ db: &Pool<Postgres>,+ user_id: &str,+ exclude_owned: bool,+) -> anyhow::Result<Vec<UserAccessibleItem>> {+ let ids = sqlx::query_scalar!(r#"WITH user_source_ids AS (SELECT cp.channel_id::text as source_id FROM comms_channel_participants cp@@ -32,45 +127,22 @@ pub async fn get_user_accessible_items(WHERE t.user_id = $1UNION ALLSELECT $1- ),- -- Get all entities the user has access to via entity_access- UserAccessibleEntities AS (- SELECT DISTINCT- ea.entity_id,- ea.entity_type- FROM entity_access ea- WHERE ea.source_id = ANY(SELECT source_id FROM user_source_ids)- AND ($2::text IS NULL OR ea.entity_type = $2)- ),- -- Filter out deleted items and optionally exclude owned- FilteredItems AS (- SELECT uae.entity_id::text as item_id, uae.entity_type as item_type- FROM UserAccessibleEntities uae- LEFT JOIN "Document" d ON uae.entity_type = 'document' AND uae.entity_id::text = d.id- LEFT JOIN "Chat" c ON uae.entity_type = 'chat' AND uae.entity_id::text = c.id- LEFT JOIN "Project" p ON uae.entity_type = 'project' AND uae.entity_id::text = p.id- WHERE- (uae.entity_type = 'document' AND d."deletedAt" IS NULL- AND ($3 = false OR d.owner != $1)) OR- (uae.entity_type = 'chat' AND c."deletedAt" IS NULL- AND ($3 = false OR c."userId" != $1)) OR- (uae.entity_type = 'project' AND p."deletedAt" IS NULL- AND ($3 = false OR p."userId" != $1)))- SELECT item_id as "item_id!", item_type as "item_type!" FROM FilteredItems+ SELECT DISTINCT ea.entity_id::text as "item_id!"+ FROM entity_access ea+ JOIN user_source_ids us ON us.source_id = ea.source_id+ JOIN "Project" p ON p.id = ea.entity_id::text+ WHERE ea.entity_type = 'project'+ AND p."deletedAt" IS NULL+ AND (NOT $2 OR p."userId" != $1)"#,user_id,- item_type_filter,exclude_owned)- .map(|r| UserAccessibleItem {- item_id: r.item_id,- item_type: r.item_type,- }).fetch_all(db).await?;- Ok(results)+ Ok(to_items(ids, "project"))}#[cfg(test)]diff --git a/crates/soup/src/outbound/pg_soup_repo/expanded/by_ids.rs b/crates/soup/src/outbound/pg_soup_repo/expanded/by_ids.rsindex 5432c6264f..804d6f9075 100644--- a/crates/soup/src/outbound/pg_soup_repo/expanded/by_ids.rs+++ b/crates/soup/src/outbound/pg_soup_repo/expanded/by_ids.rs@@ -14,7 +14,7 @@ use uuid::Uuid;/// permissions through project hierarchy. If a user has access to a project that contains/// the requested items, those items WILL be included in the results even if the user doesn't/// have explicit permissions on them. Project items themselves are excluded from results --/// only documents and chats are returned. Results are sorted to match the input entity order.+/// only documents and chats are returned. Result order is unspecified.#[tracing::instrument(err, skip(db, entities))]pub async fn expanded_soup_by_ids<'a>(db: &PgPool,diff --git a/crates/soup/src/outbound/pg_soup_repo/expanded/tests.rs b/crates/soup/src/outbound/pg_soup_repo/expanded/tests.rsindex 21bbe1450f..51503798c5 100644--- a/crates/soup/src/outbound/pg_soup_repo/expanded/tests.rs+++ b/crates/soup/src/outbound/pg_soup_repo/expanded/tests.rs@@ -331,7 +331,7 @@ async fn test_expanded_generic_sorting_methods(pool: Pool<Postgres>) -> anyhow::Ok(())}-// Test that expanded_soup_by_ids returns items in the correct order and includes items with implicit access+// Test that expanded_soup_by_ids includes items with implicit access#[sqlx::test(migrator = "MACRO_DB_MIGRATIONS",fixtures(@@ -360,37 +360,30 @@ async fn test_expanded_soup_by_ids(pool: Pool<Postgres>) {// Verify we can access items through project inheritance// doc-in-A is in project-A which user-1 has access to+ let expected_doc_id = Uuid::parse_str("11111111-aaaa-aaaa-aaaa-aaaaaaaaaaaa").unwrap(); // doc-in-A+ let expected_project_id = Uuid::parse_str("aaaaaaaa-ffff-ffff-ffff-ffffffffffff").unwrap(); // project-Alet doc = items.iter().find_map(|x| match x {- SoupItem::Document(soup_document) => Some(soup_document),- SoupItem::Chat(_)- | SoupItem::Project(_)- | SoupItem::EmailThread(_)- | SoupItem::Channel(_)- | SoupItem::ChannelThread(_)- | SoupItem::Call(_)- | SoupItem::CrmCompany(_)- | SoupItem::ForeignEntity(_) => None,+ SoupItem::Document(soup_document) if soup_document.id == expected_doc_id => {+ Some(soup_document)+ }+ _ => None,}).expect("The document should exist");- let expected_doc_id = Uuid::parse_str("11111111-aaaa-aaaa-aaaa-aaaaaaaaaaaa").unwrap(); // doc-in-A- let expected_project_id = Uuid::parse_str("aaaaaaaa-ffff-ffff-ffff-ffffffffffff").unwrap(); // project-A- assert_eq!(doc.id, expected_doc_id);assert_eq!(doc.name, "Document in A");assert_eq!(doc.project_id, Some(expected_project_id));// chat-in-B is in project-B which is a child of project-A+ let expected_chat_id = Uuid::parse_str("22222222-bbbb-bbbb-bbbb-bbbbbbbbbbbb").unwrap(); // chat-in-B+ let expected_project_id = Uuid::parse_str("bbbbbbbb-ffff-ffff-ffff-ffffffffffff").unwrap(); // project-Blet chat = items.iter().find_map(|x| match x {- SoupItem::Chat(soup_chat) => Some(soup_chat),+ SoupItem::Chat(soup_chat) if soup_chat.id == expected_chat_id => Some(soup_chat),_ => None,}).expect("The chat should exist");- let expected_chat_id = Uuid::parse_str("22222222-bbbb-bbbb-bbbb-bbbbbbbbbbbb").unwrap(); // chat-in-B- let expected_project_id = Uuid::parse_str("bbbbbbbb-ffff-ffff-ffff-ffffffffffff").unwrap(); // project-B- assert_eq!(chat.id, expected_chat_id);assert_eq!(chat.name, "Chat in B");assert_eq!(chat.project_id.as_ref(), Some(&expected_project_id));}diff --git a/crates/soup/src/outbound/pg_soup_repo/unexpanded/by_ids.rs b/crates/soup/src/outbound/pg_soup_repo/unexpanded/by_ids.rsindex 79a12a5108..b4a9c41db1 100644--- a/crates/soup/src/outbound/pg_soup_repo/unexpanded/by_ids.rs+++ b/crates/soup/src/outbound/pg_soup_repo/unexpanded/by_ids.rs@@ -14,7 +14,7 @@ use uuid::Uuid;/// If a user has access to a project that contains other items, those "child" items will NOT/// be included in the results unless the user has been explicitly granted permissions on them./// This ensures that only directly authorized items are returned, not those with implicit-/// (inherited) access. Results are sorted to match the input entity order.+/// (inherited) access. Result order is unspecified.#[tracing::instrument(err, skip(db, entities))]pub async fn unexpanded_soup_by_ids<'a>(db: &PgPool,diff --git a/crates/soup/src/outbound/pg_soup_repo/unexpanded/tests.rs b/crates/soup/src/outbound/pg_soup_repo/unexpanded/tests.rsindex 84a74e0312..66d5090d1c 100644--- a/crates/soup/src/outbound/pg_soup_repo/unexpanded/tests.rs+++ b/crates/soup/src/outbound/pg_soup_repo/unexpanded/tests.rs@@ -281,7 +281,7 @@ async fn test_get_user_items_unexpanded_cursor(pool: Pool<Postgres>) -> anyhow::Ok(())}-// Test that unexpanded_soup_by_ids returns items in the correct order and only includes explicit access+// Test that unexpanded_soup_by_ids only includes explicit access#[sqlx::test(migrator = "MACRO_DB_MIGRATIONS",fixtures(