Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

Seanaye/fix/reduce notification payloads (#7999)

Sean Ayeaaf23eba656c
diff --git a/.sqlx/query-048d7c334accc1492f9c8e544a35910f9c747f1d5fbdbb891ade13d89c649939.json b/.sqlx/query-048d7c334accc1492f9c8e544a35910f9c747f1d5fbdbb891ade13d89c649939.json
deleted file mode 100644
index 39c8425243..0000000000
--- a/.sqlx/query-048d7c334accc1492f9c8e544a35910f9c747f1d5fbdbb891ade13d89c649939.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE calendars SET access_role='freeBusyReader' WHERE id=$1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "048d7c334accc1492f9c8e544a35910f9c747f1d5fbdbb891ade13d89c649939"
-}
diff --git a/.sqlx/query-05016877d16bc358544653739ae4049e57e021d1bcfdc0dcfa506ff1d9eaaa50.json b/.sqlx/query-05016877d16bc358544653739ae4049e57e021d1bcfdc0dcfa506ff1d9eaaa50.json
deleted file mode 100644
index 2a9015f3fa..0000000000
--- a/.sqlx/query-05016877d16bc358544653739ae4049e57e021d1bcfdc0dcfa506ff1d9eaaa50.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE calendars SET sync_token = 'old-token', synced_at = now(), materialized_starts_at = now(), materialized_ends_at = now() + interval '1 day', materialized_start_date = current_date, materialized_end_date = current_date + 1 WHERE id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "05016877d16bc358544653739ae4049e57e021d1bcfdc0dcfa506ff1d9eaaa50"
-}
diff --git a/.sqlx/query-0b70e5ea741ce33ef5347fcdd0ad63c7f57c0a627ec7eeb6d97995d144d05ba2.json b/.sqlx/query-0b70e5ea741ce33ef5347fcdd0ad63c7f57c0a627ec7eeb6d97995d144d05ba2.json
deleted file mode 100644
index c0095f6ebd..0000000000
--- a/.sqlx/query-0b70e5ea741ce33ef5347fcdd0ad63c7f57c0a627ec7eeb6d97995d144d05ba2.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO calendar_team_sharing(user_id,sharing) SELECT unnest($1::text[]),'all' ON CONFLICT(user_id) DO UPDATE SET sharing='all'",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "TextArray"
- ]
- },
- "nullable": []
- },
- "hash": "0b70e5ea741ce33ef5347fcdd0ad63c7f57c0a627ec7eeb6d97995d144d05ba2"
-}
diff --git a/.sqlx/query-122f8321d98595e2ce5114364181264de62860e7817195eb7c002d2a6c3f8443.json b/.sqlx/query-122f8321d98595e2ce5114364181264de62860e7817195eb7c002d2a6c3f8443.json
deleted file mode 100644
index 603b2098f9..0000000000
--- a/.sqlx/query-122f8321d98595e2ce5114364181264de62860e7817195eb7c002d2a6c3f8443.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT provider_access_role FROM calendar_event_sources WHERE event_id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "provider_access_role",
- "type_info": "Text"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- true
- ]
- },
- "hash": "122f8321d98595e2ce5114364181264de62860e7817195eb7c002d2a6c3f8443"
-}
diff --git a/.sqlx/query-14ee02554114e96cd83c22256cf9673693423f7041b5cfa01e0ee69065b9809a.json b/.sqlx/query-14ee02554114e96cd83c22256cf9673693423f7041b5cfa01e0ee69065b9809a.json
deleted file mode 100644
index 8ff1f0995f..0000000000
--- a/.sqlx/query-14ee02554114e96cd83c22256cf9673693423f7041b5cfa01e0ee69065b9809a.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT extracted_count FROM calendar_backfill_jobs WHERE id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "extracted_count",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- false
- ]
- },
- "hash": "14ee02554114e96cd83c22256cf9673693423f7041b5cfa01e0ee69065b9809a"
-}
diff --git a/.sqlx/query-154a7cdea2cba555530eaee8ffcd5d73916d500e67cb3afc048072d1b76a6951.json b/.sqlx/query-154a7cdea2cba555530eaee8ffcd5d73916d500e67cb3afc048072d1b76a6951.json
deleted file mode 100644
index 74eceb78c7..0000000000
--- a/.sqlx/query-154a7cdea2cba555530eaee8ffcd5d73916d500e67cb3afc048072d1b76a6951.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO team_user (team_id, user_id, team_role) VALUES ($1, $2, 'member')",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "154a7cdea2cba555530eaee8ffcd5d73916d500e67cb3afc048072d1b76a6951"
-}
diff --git a/.sqlx/query-15801664350470a713a8d4aac0cc7baa4b789c57c02b8814dcc318f84cd1b134.json b/.sqlx/query-15801664350470a713a8d4aac0cc7baa4b789c57c02b8814dcc318f84cd1b134.json
deleted file mode 100644
index 3be1ab553c..0000000000
--- a/.sqlx/query-15801664350470a713a8d4aac0cc7baa4b789c57c02b8814dcc318f84cd1b134.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT count(*) AS \"count!\" FROM calendar_accounts WHERE email_link_id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "count!",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- null
- ]
- },
- "hash": "15801664350470a713a8d4aac0cc7baa4b789c57c02b8814dcc318f84cd1b134"
-}
diff --git a/.sqlx/query-16376437fec571254c20bc47e4cbbc5a5e13bb90651ad24c2281b2154f10dea3.json b/.sqlx/query-16376437fec571254c20bc47e4cbbc5a5e13bb90651ad24c2281b2154f10dea3.json
deleted file mode 100644
index 8588e42975..0000000000
--- a/.sqlx/query-16376437fec571254c20bc47e4cbbc5a5e13bb90651ad24c2281b2154f10dea3.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE calendars SET sync_token='legacy',synced_at=now(),materialized_starts_at='2026-07-01',materialized_ends_at='2026-08-01',materialized_start_date='2026-07-01',materialized_end_date='2026-08-01' WHERE id=$1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "16376437fec571254c20bc47e4cbbc5a5e13bb90651ad24c2281b2154f10dea3"
-}
diff --git a/.sqlx/query-16d72a752357648effb2327791a771b02d72dd71725f71a90b4e7f05d87f2644.json b/.sqlx/query-16d72a752357648effb2327791a771b02d72dd71725f71a90b4e7f05d87f2644.json
deleted file mode 100644
index 03b1b3fb24..0000000000
--- a/.sqlx/query-16d72a752357648effb2327791a771b02d72dd71725f71a90b4e7f05d87f2644.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO team_user (user_id, team_id, team_role) VALUES ($1, $2, 'member')",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Text",
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "16d72a752357648effb2327791a771b02d72dd71725f71a90b4e7f05d87f2644"
-}
diff --git a/.sqlx/query-177b005aa26af6953e523b6f53355b396bef5ed052e2aabdc3bed06a80389779.json b/.sqlx/query-177b005aa26af6953e523b6f53355b396bef5ed052e2aabdc3bed06a80389779.json
deleted file mode 100644
index 2ac543b204..0000000000
--- a/.sqlx/query-177b005aa26af6953e523b6f53355b396bef5ed052e2aabdc3bed06a80389779.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT content_source_id = calendar_event_canonical_source_id(id) AS \"mirrors!\"\n FROM calendar_events\n WHERE id = $1\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "mirrors!",
- "type_info": "Bool"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- null
- ]
- },
- "hash": "177b005aa26af6953e523b6f53355b396bef5ed052e2aabdc3bed06a80389779"
-}
diff --git a/.sqlx/query-1d44982cbdaf17e6586a5fc0b71ad09152b5ee540880848168c842f6e6dc2aa3.json b/.sqlx/query-1d44982cbdaf17e6586a5fc0b71ad09152b5ee540880848168c842f6e6dc2aa3.json
deleted file mode 100644
index 7620aa97ce..0000000000
--- a/.sqlx/query-1d44982cbdaf17e6586a5fc0b71ad09152b5ee540880848168c842f6e6dc2aa3.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE calendar_accounts SET sync_status = 'ready' WHERE id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "1d44982cbdaf17e6586a5fc0b71ad09152b5ee540880848168c842f6e6dc2aa3"
-}
diff --git a/.sqlx/query-1dd792d6ed050b56a4831387b67941bf86b5dcb717bf6ea72ab71762cf0ff84d.json b/.sqlx/query-1dd792d6ed050b56a4831387b67941bf86b5dcb717bf6ea72ab71762cf0ff84d.json
deleted file mode 100644
index 463c89b3f6..0000000000
--- a/.sqlx/query-1dd792d6ed050b56a4831387b67941bf86b5dcb717bf6ea72ab71762cf0ff84d.json
+++ /dev/null
@@ -1,54 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT\n account.sync_status,\n calendar.is_deleted,\n google_job.status AS google_job_status,\n google_job.lease_token,\n (SELECT count(*) FROM calendar_event_sources WHERE event_id = $3) AS \"source_count!\",\n (SELECT count(*) FROM calendar_events WHERE id = $3) AS \"event_count!\"\n FROM calendar_accounts account\n JOIN calendars calendar ON calendar.account_id = account.id\n JOIN calendar_backfill_jobs google_job ON google_job.id = $2\n WHERE account.id = $1\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "sync_status",
- "type_info": "Text"
- },
- {
- "ordinal": 1,
- "name": "is_deleted",
- "type_info": "Bool"
- },
- {
- "ordinal": 2,
- "name": "google_job_status",
- "type_info": "Text"
- },
- {
- "ordinal": 3,
- "name": "lease_token",
- "type_info": "Uuid"
- },
- {
- "ordinal": 4,
- "name": "source_count!",
- "type_info": "Int8"
- },
- {
- "ordinal": 5,
- "name": "event_count!",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid",
- "Uuid",
- "Uuid"
- ]
- },
- "nullable": [
- false,
- false,
- false,
- true,
- null,
- null
- ]
- },
- "hash": "1dd792d6ed050b56a4831387b67941bf86b5dcb717bf6ea72ab71762cf0ff84d"
-}
diff --git a/.sqlx/query-1fb5efa6c440e451ded7952583828fe22b246cc085e1317004d4b5fd61b4ccf8.json b/.sqlx/query-1fb5efa6c440e451ded7952583828fe22b246cc085e1317004d4b5fd61b4ccf8.json
deleted file mode 100644
index e7e27cd21e..0000000000
--- a/.sqlx/query-1fb5efa6c440e451ded7952583828fe22b246cc085e1317004d4b5fd61b4ccf8.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT email_link_id FROM calendar_accounts WHERE id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "email_link_id",
- "type_info": "Uuid"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- false
- ]
- },
- "hash": "1fb5efa6c440e451ded7952583828fe22b246cc085e1317004d4b5fd61b4ccf8"
-}
diff --git a/.sqlx/query-200af5f502688067fe0ee28203bb8090cda1461c32835333250789b8bd1bf1a6.json b/.sqlx/query-200af5f502688067fe0ee28203bb8090cda1461c32835333250789b8bd1bf1a6.json
deleted file mode 100644
index f6da207cdc..0000000000
--- a/.sqlx/query-200af5f502688067fe0ee28203bb8090cda1461c32835333250789b8bd1bf1a6.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE calendar_backfill_jobs SET status = 'failed' WHERE id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "200af5f502688067fe0ee28203bb8090cda1461c32835333250789b8bd1bf1a6"
-}
diff --git a/.sqlx/query-20d5598c949a2bc87254a7216d6f7111a30b47706466c50aa24f365c18456ec4.json b/.sqlx/query-20d5598c949a2bc87254a7216d6f7111a30b47706466c50aa24f365c18456ec4.json
deleted file mode 100644
index b1600d87dc..0000000000
--- a/.sqlx/query-20d5598c949a2bc87254a7216d6f7111a30b47706466c50aa24f365c18456ec4.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "DELETE FROM email_link_google_scopes WHERE link_id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "20d5598c949a2bc87254a7216d6f7111a30b47706466c50aa24f365c18456ec4"
-}
diff --git a/.sqlx/query-23a5ade6bad11749a69aebfee0b259db5d80daeb2ca9afb0daeca5273e494869.json b/.sqlx/query-23a5ade6bad11749a69aebfee0b259db5d80daeb2ca9afb0daeca5273e494869.json
deleted file mode 100644
index 5c9d683260..0000000000
--- a/.sqlx/query-23a5ade6bad11749a69aebfee0b259db5d80daeb2ca9afb0daeca5273e494869.json
+++ /dev/null
@@ -1,28 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT sync_status, last_sync_error FROM calendar_accounts WHERE id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "sync_status",
- "type_info": "Text"
- },
- {
- "ordinal": 1,
- "name": "last_sync_error",
- "type_info": "Text"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- false,
- true
- ]
- },
- "hash": "23a5ade6bad11749a69aebfee0b259db5d80daeb2ca9afb0daeca5273e494869"
-}
diff --git a/.sqlx/query-23d9f97b2e79c6cb15fc6cf68e74c892f7e0d561597bd7aaac3b7cb8694a4522.json b/.sqlx/query-23d9f97b2e79c6cb15fc6cf68e74c892f7e0d561597bd7aaac3b7cb8694a4522.json
deleted file mode 100644
index 5d0ad6f28b..0000000000
--- a/.sqlx/query-23d9f97b2e79c6cb15fc6cf68e74c892f7e0d561597bd7aaac3b7cb8694a4522.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO macro_user_links (primary_macro_id, child_macro_id, link_id)\n VALUES ($1, $2, $3)\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Text",
- "Text",
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "23d9f97b2e79c6cb15fc6cf68e74c892f7e0d561597bd7aaac3b7cb8694a4522"
-}
diff --git a/.sqlx/query-271cabf16f8165dbf9cfe5fdb4dbea06aed255f7435ab325972cce7e5f118a9f.json b/.sqlx/query-271cabf16f8165dbf9cfe5fdb4dbea06aed255f7435ab325972cce7e5f118a9f.json
deleted file mode 100644
index 8efb137671..0000000000
--- a/.sqlx/query-271cabf16f8165dbf9cfe5fdb4dbea06aed255f7435ab325972cce7e5f118a9f.json
+++ /dev/null
@@ -1,34 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT\n granted_scopes,\n grant_version,\n (calendar_disabled_at IS NOT NULL) AS \"opted_out!\"\n FROM email_link_google_scopes\n WHERE link_id = $1\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "granted_scopes",
- "type_info": "TextArray"
- },
- {
- "ordinal": 1,
- "name": "grant_version",
- "type_info": "Int8"
- },
- {
- "ordinal": 2,
- "name": "opted_out!",
- "type_info": "Bool"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- false,
- false,
- null
- ]
- },
- "hash": "271cabf16f8165dbf9cfe5fdb4dbea06aed255f7435ab325972cce7e5f118a9f"
-}
diff --git a/.sqlx/query-2e37770ebdaebc9783b9151906507abeafbfe023185b1dfd99ec8359863eadc8.json b/.sqlx/query-2e37770ebdaebc9783b9151906507abeafbfe023185b1dfd99ec8359863eadc8.json
deleted file mode 100644
index 357db13e7e..0000000000
--- a/.sqlx/query-2e37770ebdaebc9783b9151906507abeafbfe023185b1dfd99ec8359863eadc8.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE calendar_accounts SET sync_status=$2,last_synced_at=CASE WHEN $3 THEN now()-interval '16 minutes' ELSE now() END,last_sync_error=$4 WHERE id=$1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text",
- "Bool",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "2e37770ebdaebc9783b9151906507abeafbfe023185b1dfd99ec8359863eadc8"
-}
diff --git a/.sqlx/query-2fb0911e795e7c12298a5b1ee3b9a532c4f336ee483fa5219d8e27848854812b.json b/.sqlx/query-2fb0911e795e7c12298a5b1ee3b9a532c4f336ee483fa5219d8e27848854812b.json
deleted file mode 100644
index f076f1e3da..0000000000
--- a/.sqlx/query-2fb0911e795e7c12298a5b1ee3b9a532c4f336ee483fa5219d8e27848854812b.json
+++ /dev/null
@@ -1,34 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT\n l.updated_at AS \"link_updated_at!\",\n g.granted_scopes AS \"side_scopes!\",\n g.grant_version AS \"side_version!\"\n FROM email_links l\n JOIN email_link_google_scopes g ON g.link_id = l.id\n WHERE l.id = $1\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "link_updated_at!",
- "type_info": "Timestamptz"
- },
- {
- "ordinal": 1,
- "name": "side_scopes!",
- "type_info": "TextArray"
- },
- {
- "ordinal": 2,
- "name": "side_version!",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- false,
- false,
- false
- ]
- },
- "hash": "2fb0911e795e7c12298a5b1ee3b9a532c4f336ee483fa5219d8e27848854812b"
-}
diff --git a/.sqlx/query-32a3fe8bf63bb740886a60758461b4b7e2f0c1c5ac6dcab392bae63d69b584d0.json b/.sqlx/query-32a3fe8bf63bb740886a60758461b4b7e2f0c1c5ac6dcab392bae63d69b584d0.json
deleted file mode 100644
index e1e3810f6e..0000000000
--- a/.sqlx/query-32a3fe8bf63bb740886a60758461b4b7e2f0c1c5ac6dcab392bae63d69b584d0.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE calendars SET snapshot_normalization_version=1 WHERE account_id=$1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "32a3fe8bf63bb740886a60758461b4b7e2f0c1c5ac6dcab392bae63d69b584d0"
-}
diff --git a/.sqlx/query-3317b176c3743666b64b1c4189f881064130838b1c285b3e8bc1085a2e95d877.json b/.sqlx/query-3317b176c3743666b64b1c4189f881064130838b1c285b3e8bc1085a2e95d877.json
deleted file mode 100644
index 939d1def31..0000000000
--- a/.sqlx/query-3317b176c3743666b64b1c4189f881064130838b1c285b3e8bc1085a2e95d877.json
+++ /dev/null
@@ -1,38 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT source_id, source_type AS \"source_type: EntityAccessSourceType\"\n FROM entity_access ORDER BY id",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "source_id",
- "type_info": "Text"
- },
- {
- "ordinal": 1,
- "name": "source_type: EntityAccessSourceType",
- "type_info": {
- "Custom": {
- "name": "entity_access_source_type",
- "kind": {
- "Enum": [
- "channel",
- "team",
- "user",
- "bot"
- ]
- }
- }
- }
- }
- ],
- "parameters": {
- "Left": []
- },
- "nullable": [
- false,
- false
- ]
- },
- "hash": "3317b176c3743666b64b1c4189f881064130838b1c285b3e8bc1085a2e95d877"
-}
diff --git a/.sqlx/query-34522f084618ec8c439d4d7141f855519abb2e8789e29b68e31fe07037eaebaa.json b/.sqlx/query-34522f084618ec8c439d4d7141f855519abb2e8789e29b68e31fe07037eaebaa.json
deleted file mode 100644
index e9cbd2ca63..0000000000
--- a/.sqlx/query-34522f084618ec8c439d4d7141f855519abb2e8789e29b68e31fe07037eaebaa.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE calendars SET snapshot_normalization_version=1 WHERE account_id IN (SELECT id FROM calendar_accounts WHERE owner_id=ANY($1::text[]))",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "TextArray"
- ]
- },
- "nullable": []
- },
- "hash": "34522f084618ec8c439d4d7141f855519abb2e8789e29b68e31fe07037eaebaa"
-}
diff --git a/.sqlx/query-354282687eab48f146f07c5645e912454428fd700d977d2154f1ed2f48cd242d.json b/.sqlx/query-354282687eab48f146f07c5645e912454428fd700d977d2154f1ed2f48cd242d.json
deleted file mode 100644
index 399bd1007e..0000000000
--- a/.sqlx/query-354282687eab48f146f07c5645e912454428fd700d977d2154f1ed2f48cd242d.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT source.provider_access_role = calendar.access_role AS \"eligible!\" FROM calendar_event_sources source JOIN calendars calendar ON calendar.id=source.calendar_id WHERE source.event_id=$1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "eligible!",
- "type_info": "Bool"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- null
- ]
- },
- "hash": "354282687eab48f146f07c5645e912454428fd700d977d2154f1ed2f48cd242d"
-}
diff --git a/.sqlx/query-35dfe22e0fef3729d34e6e767abbaeb356c636818204b2e858f9498f504e077e.json b/.sqlx/query-35dfe22e0fef3729d34e6e767abbaeb356c636818204b2e858f9498f504e077e.json
deleted file mode 100644
index d2f3870625..0000000000
--- a/.sqlx/query-35dfe22e0fef3729d34e6e767abbaeb356c636818204b2e858f9498f504e077e.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE calendars SET is_deleted = true WHERE id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "35dfe22e0fef3729d34e6e767abbaeb356c636818204b2e858f9498f504e077e"
-}
diff --git a/.sqlx/query-3673d629b8923763a5e72e25dadd558ade112c8142bb86ca6b87585b1c126573.json b/.sqlx/query-3673d629b8923763a5e72e25dadd558ade112c8142bb86ca6b87585b1c126573.json
deleted file mode 100644
index 44a03efc03..0000000000
--- a/.sqlx/query-3673d629b8923763a5e72e25dadd558ade112c8142bb86ca6b87585b1c126573.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT title FROM calendar_events WHERE id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "title",
- "type_info": "Text"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- false
- ]
- },
- "hash": "3673d629b8923763a5e72e25dadd558ade112c8142bb86ca6b87585b1c126573"
-}
diff --git a/.sqlx/query-36b5dba37448891e85fe3816fe8eee004599d915ecf96708150ba484cb2ac36a.json b/.sqlx/query-36b5dba37448891e85fe3816fe8eee004599d915ecf96708150ba484cb2ac36a.json
deleted file mode 100644
index 068782e3dd..0000000000
--- a/.sqlx/query-36b5dba37448891e85fe3816fe8eee004599d915ecf96708150ba484cb2ac36a.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT email_address FROM email_links WHERE id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "email_address",
- "type_info": "Varchar"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- false
- ]
- },
- "hash": "36b5dba37448891e85fe3816fe8eee004599d915ecf96708150ba484cb2ac36a"
-}
diff --git a/.sqlx/query-37f6d5aaa0bdb275bbeb0d9939007dbdf9e08508af65b18fcbfe63417791741f.json b/.sqlx/query-37f6d5aaa0bdb275bbeb0d9939007dbdf9e08508af65b18fcbfe63417791741f.json
deleted file mode 100644
index 0c9fc51736..0000000000
--- a/.sqlx/query-37f6d5aaa0bdb275bbeb0d9939007dbdf9e08508af65b18fcbfe63417791741f.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE calendars SET synced_at=now() WHERE account_id IN (SELECT id FROM calendar_accounts WHERE owner_id=ANY($1::text[]))",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "TextArray"
- ]
- },
- "nullable": []
- },
- "hash": "37f6d5aaa0bdb275bbeb0d9939007dbdf9e08508af65b18fcbfe63417791741f"
-}
diff --git a/.sqlx/query-3947c3b25e46cc39c6f42d206d51cf8ad81380582634217b037bb56aee69e39a.json b/.sqlx/query-3947c3b25e46cc39c6f42d206d51cf8ad81380582634217b037bb56aee69e39a.json
deleted file mode 100644
index 3b1be0f346..0000000000
--- a/.sqlx/query-3947c3b25e46cc39c6f42d206d51cf8ad81380582634217b037bb56aee69e39a.json
+++ /dev/null
@@ -1,34 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT\n (SELECT title FROM calendar_events WHERE id = $1) AS \"title!\",\n (SELECT calendar_id FROM calendar_event_sources WHERE event_id = $1) AS \"calendar_id\",\n (SELECT count(*) FROM calendar_event_sources WHERE event_id = $1) AS \"sources!\"\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "title!",
- "type_info": "Text"
- },
- {
- "ordinal": 1,
- "name": "calendar_id",
- "type_info": "Uuid"
- },
- {
- "ordinal": 2,
- "name": "sources!",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- null,
- null,
- null
- ]
- },
- "hash": "3947c3b25e46cc39c6f42d206d51cf8ad81380582634217b037bb56aee69e39a"
-}
diff --git a/.sqlx/query-3b2dbc5b0affbcf53cfe76fe5210b7e4d96dad61a84d4a87dced9d2f66dc6ff1.json b/.sqlx/query-3b2dbc5b0affbcf53cfe76fe5210b7e4d96dad61a84d4a87dced9d2f66dc6ff1.json
deleted file mode 100644
index 53c3c181dc..0000000000
--- a/.sqlx/query-3b2dbc5b0affbcf53cfe76fe5210b7e4d96dad61a84d4a87dced9d2f66dc6ff1.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO team (id, name, owner_id) VALUES ($1, 'Team', $2)",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "3b2dbc5b0affbcf53cfe76fe5210b7e4d96dad61a84d4a87dced9d2f66dc6ff1"
-}
diff --git a/.sqlx/query-3ba0c278a5da5c6d0c96ce0a8582fb9a15268c8e06d63ad779502d7ef363d04a.json b/.sqlx/query-3ba0c278a5da5c6d0c96ce0a8582fb9a15268c8e06d63ad779502d7ef363d04a.json
deleted file mode 100644
index 059321cdac..0000000000
--- a/.sqlx/query-3ba0c278a5da5c6d0c96ce0a8582fb9a15268c8e06d63ad779502d7ef363d04a.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE calendars SET sync_token='legacy-after-strict',synced_at=now() WHERE id=$1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "3ba0c278a5da5c6d0c96ce0a8582fb9a15268c8e06d63ad779502d7ef363d04a"
-}
diff --git a/.sqlx/query-3ca251d8dd2b823ddc85a8c7a2b88b6769ba94f57ac9f4f9d61008cfcce01bfc.json b/.sqlx/query-3ca251d8dd2b823ddc85a8c7a2b88b6769ba94f57ac9f4f9d61008cfcce01bfc.json
deleted file mode 100644
index 3fd610668f..0000000000
--- a/.sqlx/query-3ca251d8dd2b823ddc85a8c7a2b88b6769ba94f57ac9f4f9d61008cfcce01bfc.json
+++ /dev/null
@@ -1,76 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT title, event_type, is_read_only, transparency, visibility,\n reminders_use_default, reminder_overrides, creator_email,\n sequence, schedule_updated_at\n FROM calendar_events WHERE id = $1\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "title",
- "type_info": "Text"
- },
- {
- "ordinal": 1,
- "name": "event_type",
- "type_info": "Text"
- },
- {
- "ordinal": 2,
- "name": "is_read_only",
- "type_info": "Bool"
- },
- {
- "ordinal": 3,
- "name": "transparency",
- "type_info": "Text"
- },
- {
- "ordinal": 4,
- "name": "visibility",
- "type_info": "Text"
- },
- {
- "ordinal": 5,
- "name": "reminders_use_default",
- "type_info": "Bool"
- },
- {
- "ordinal": 6,
- "name": "reminder_overrides",
- "type_info": "Jsonb"
- },
- {
- "ordinal": 7,
- "name": "creator_email",
- "type_info": "Text"
- },
- {
- "ordinal": 8,
- "name": "sequence",
- "type_info": "Int4"
- },
- {
- "ordinal": 9,
- "name": "schedule_updated_at",
- "type_info": "Timestamptz"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- false,
- false,
- false,
- false,
- false,
- false,
- false,
- true,
- false,
- false
- ]
- },
- "hash": "3ca251d8dd2b823ddc85a8c7a2b88b6769ba94f57ac9f4f9d61008cfcce01bfc"
-}
diff --git a/.sqlx/query-3deead68fac93d24fea0bdab60d12eed72e8ae64467266a23a298460bbffeafa.json b/.sqlx/query-3deead68fac93d24fea0bdab60d12eed72e8ae64467266a23a298460bbffeafa.json
deleted file mode 100644
index 89625d37fc..0000000000
--- a/.sqlx/query-3deead68fac93d24fea0bdab60d12eed72e8ae64467266a23a298460bbffeafa.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE calendar_accounts SET sync_status='ready',last_synced_at=now(),last_sync_error=NULL WHERE owner_id=ANY($1::text[]) AND sync_status<>'disabled'",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "TextArray"
- ]
- },
- "nullable": []
- },
- "hash": "3deead68fac93d24fea0bdab60d12eed72e8ae64467266a23a298460bbffeafa"
-}
diff --git a/.sqlx/query-41f742e117f90b536a9e5b1780188d69354cbffb1f779e9bccc874613d6287d3.json b/.sqlx/query-41f742e117f90b536a9e5b1780188d69354cbffb1f779e9bccc874613d6287d3.json
deleted file mode 100644
index b48fdcf509..0000000000
--- a/.sqlx/query-41f742e117f90b536a9e5b1780188d69354cbffb1f779e9bccc874613d6287d3.json
+++ /dev/null
@@ -1,60 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT\n (SELECT count(*) FROM calendar_accounts WHERE email_link_id = $1) AS \"accounts!\",\n (SELECT count(*) FROM calendars WHERE account_id = $2) AS \"calendars!\",\n (SELECT count(*) FROM calendar_events WHERE source_link_id = $1) AS \"events!\",\n (SELECT count(*) FROM calendar_event_sources WHERE source_link_id = $1) AS \"sources!\",\n (SELECT count(*) FROM calendar_event_occurrences WHERE event_id = $3) AS \"occurrences!\",\n (SELECT count(*) FROM calendar_event_reminder_deliveries WHERE event_id = $3) AS \"deliveries!\",\n (SELECT count(*) FROM calendar_backfill_jobs WHERE email_link_id = $1) AS \"jobs!\"\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "accounts!",
- "type_info": "Int8"
- },
- {
- "ordinal": 1,
- "name": "calendars!",
- "type_info": "Int8"
- },
- {
- "ordinal": 2,
- "name": "events!",
- "type_info": "Int8"
- },
- {
- "ordinal": 3,
- "name": "sources!",
- "type_info": "Int8"
- },
- {
- "ordinal": 4,
- "name": "occurrences!",
- "type_info": "Int8"
- },
- {
- "ordinal": 5,
- "name": "deliveries!",
- "type_info": "Int8"
- },
- {
- "ordinal": 6,
- "name": "jobs!",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid",
- "Uuid",
- "Uuid"
- ]
- },
- "nullable": [
- null,
- null,
- null,
- null,
- null,
- null,
- null
- ]
- },
- "hash": "41f742e117f90b536a9e5b1780188d69354cbffb1f779e9bccc874613d6287d3"
-}
diff --git a/.sqlx/query-4477a86a50518e2a048fd8300fc50b565ed649f2523633c261cc132a95557ca4.json b/.sqlx/query-4477a86a50518e2a048fd8300fc50b565ed649f2523633c261cc132a95557ca4.json
deleted file mode 100644
index 568ddbb48b..0000000000
--- a/.sqlx/query-4477a86a50518e2a048fd8300fc50b565ed649f2523633c261cc132a95557ca4.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO ai_billing_account (user_id) VALUES ($1)",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "4477a86a50518e2a048fd8300fc50b565ed649f2523633c261cc132a95557ca4"
-}
diff --git a/.sqlx/query-44aa6e5bbd1c218a0ba6e8678544e31058c23466c4de3168ea0adef13e060b5c.json b/.sqlx/query-44aa6e5bbd1c218a0ba6e8678544e31058c23466c4de3168ea0adef13e060b5c.json
deleted file mode 100644
index 6dda114ff7..0000000000
--- a/.sqlx/query-44aa6e5bbd1c218a0ba6e8678544e31058c23466c4de3168ea0adef13e060b5c.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT snapshot_normalization_version FROM calendars WHERE id=$1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "snapshot_normalization_version",
- "type_info": "Int4"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- false
- ]
- },
- "hash": "44aa6e5bbd1c218a0ba6e8678544e31058c23466c4de3168ea0adef13e060b5c"
-}
diff --git a/.sqlx/query-47c1191b50d81a7933e3b9680808ab9ed74dd974cdbdad74b3e2b9e1bc9b5778.json b/.sqlx/query-47c1191b50d81a7933e3b9680808ab9ed74dd974cdbdad74b3e2b9e1bc9b5778.json
deleted file mode 100644
index 4d7e66d596..0000000000
--- a/.sqlx/query-47c1191b50d81a7933e3b9680808ab9ed74dd974cdbdad74b3e2b9e1bc9b5778.json
+++ /dev/null
@@ -1,28 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT sync_token, synced_at FROM calendars WHERE id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "sync_token",
- "type_info": "Text"
- },
- {
- "ordinal": 1,
- "name": "synced_at",
- "type_info": "Timestamptz"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- true,
- true
- ]
- },
- "hash": "47c1191b50d81a7933e3b9680808ab9ed74dd974cdbdad74b3e2b9e1bc9b5778"
-}
diff --git a/.sqlx/query-4a3f534eec6987607f0bc891fe69614811cd059ee8ead90f8f54113cb3285304.json b/.sqlx/query-4a3f534eec6987607f0bc891fe69614811cd059ee8ead90f8f54113cb3285304.json
deleted file mode 100644
index c46cc487f6..0000000000
--- a/.sqlx/query-4a3f534eec6987607f0bc891fe69614811cd059ee8ead90f8f54113cb3285304.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE calendar_backfill_jobs SET started_at = now() - interval '25 minutes', updated_at = now() - interval '20 minutes' WHERE id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "4a3f534eec6987607f0bc891fe69614811cd059ee8ead90f8f54113cb3285304"
-}
diff --git a/.sqlx/query-4b6fda6b40a7d2ba17f60eedb86f200b4b7528d27f23abbc34ce90c8d23a4680.json b/.sqlx/query-4b6fda6b40a7d2ba17f60eedb86f200b4b7528d27f23abbc34ce90c8d23a4680.json
deleted file mode 100644
index faa3bd5e34..0000000000
--- a/.sqlx/query-4b6fda6b40a7d2ba17f60eedb86f200b4b7528d27f23abbc34ce90c8d23a4680.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE calendar_accounts SET sync_status = 'disabled' WHERE id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "4b6fda6b40a7d2ba17f60eedb86f200b4b7528d27f23abbc34ce90c8d23a4680"
-}
diff --git a/.sqlx/query-4fc233f6f1e289e9acb848611c00b92d5c783802d3df1ff5a2893888246a960d.json b/.sqlx/query-4fc233f6f1e289e9acb848611c00b92d5c783802d3df1ff5a2893888246a960d.json
deleted file mode 100644
index 71d62aeb00..0000000000
--- a/.sqlx/query-4fc233f6f1e289e9acb848611c00b92d5c783802d3df1ff5a2893888246a960d.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE comms_channel_participants SET left_at = now() WHERE channel_id = $1 AND user_id = $2",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "4fc233f6f1e289e9acb848611c00b92d5c783802d3df1ff5a2893888246a960d"
-}
diff --git a/.sqlx/query-5244b960cd63a70408aef8ba2b4bc5a8c78819f16c5ff4dbd9dcc5525d3da5ee.json b/.sqlx/query-5244b960cd63a70408aef8ba2b4bc5a8c78819f16c5ff4dbd9dcc5525d3da5ee.json
deleted file mode 100644
index 43c54438a5..0000000000
--- a/.sqlx/query-5244b960cd63a70408aef8ba2b4bc5a8c78819f16c5ff4dbd9dcc5525d3da5ee.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO calendar_accounts (\n id, owner_id, email_link_id, provider, provider_account_id\n )\n VALUES ($1, $2, $3, 'google', $4)\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text",
- "Uuid",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "5244b960cd63a70408aef8ba2b4bc5a8c78819f16c5ff4dbd9dcc5525d3da5ee"
-}
diff --git a/.sqlx/query-5876b5c9567bd545e7d989557758f66640c38398431fa0cc9d696cdb31844abc.json b/.sqlx/query-5876b5c9567bd545e7d989557758f66640c38398431fa0cc9d696cdb31844abc.json
deleted file mode 100644
index 1afcc090da..0000000000
--- a/.sqlx/query-5876b5c9567bd545e7d989557758f66640c38398431fa0cc9d696cdb31844abc.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE calendar_accounts SET last_sync_error='provider failure' WHERE id=$1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "5876b5c9567bd545e7d989557758f66640c38398431fa0cc9d696cdb31844abc"
-}
diff --git a/.sqlx/query-59cfeed91e1becaca22994e1a481dbdf9ff112bc2150f1d33590aa10d3649704.json b/.sqlx/query-59cfeed91e1becaca22994e1a481dbdf9ff112bc2150f1d33590aa10d3649704.json
deleted file mode 100644
index 55e93bdb9a..0000000000
--- a/.sqlx/query-59cfeed91e1becaca22994e1a481dbdf9ff112bc2150f1d33590aa10d3649704.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "ALTER TABLE ai_credit_ledger DROP CONSTRAINT reject_test_reload",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": []
- },
- "nullable": []
- },
- "hash": "59cfeed91e1becaca22994e1a481dbdf9ff112bc2150f1d33590aa10d3649704"
-}
diff --git a/.sqlx/query-5acf6bc7936e4f8ffc693b139cd03c020effbdcd44be2c7cf13a11be639b1bee.json b/.sqlx/query-5acf6bc7936e4f8ffc693b139cd03c020effbdcd44be2c7cf13a11be639b1bee.json
deleted file mode 100644
index 20a69e65d1..0000000000
--- a/.sqlx/query-5acf6bc7936e4f8ffc693b139cd03c020effbdcd44be2c7cf13a11be639b1bee.json
+++ /dev/null
@@ -1,34 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT title, schedule_updated_at, updated_at\n FROM calendar_events\n WHERE id = $1\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "title",
- "type_info": "Text"
- },
- {
- "ordinal": 1,
- "name": "schedule_updated_at",
- "type_info": "Timestamptz"
- },
- {
- "ordinal": 2,
- "name": "updated_at",
- "type_info": "Timestamptz"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- false,
- false,
- false
- ]
- },
- "hash": "5acf6bc7936e4f8ffc693b139cd03c020effbdcd44be2c7cf13a11be639b1bee"
-}
diff --git a/.sqlx/query-5b45457b0629b66ab1694e99d7ef5119f136035f6b8489934c845c7321eade6e.json b/.sqlx/query-5b45457b0629b66ab1694e99d7ef5119f136035f6b8489934c845c7321eade6e.json
deleted file mode 100644
index 443cd1a93f..0000000000
--- a/.sqlx/query-5b45457b0629b66ab1694e99d7ef5119f136035f6b8489934c845c7321eade6e.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "DELETE FROM email_links WHERE id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "5b45457b0629b66ab1694e99d7ef5119f136035f6b8489934c845c7321eade6e"
-}
diff --git a/.sqlx/query-5f3465c9fc4de01bd3f5625f973b36d04c60756d551cf3283e72f930820212e7.json b/.sqlx/query-5f3465c9fc4de01bd3f5625f973b36d04c60756d551cf3283e72f930820212e7.json
deleted file mode 100644
index fde18c0d90..0000000000
--- a/.sqlx/query-5f3465c9fc4de01bd3f5625f973b36d04c60756d551cf3283e72f930820212e7.json
+++ /dev/null
@@ -1,34 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT\n (SELECT title FROM calendar_events WHERE id = $1) AS \"title!\",\n (SELECT count(*) FROM calendar_event_occurrences WHERE event_id = $1) AS \"occurrences!\",\n (SELECT count(*) FROM calendar_event_sources WHERE event_id = $1 AND source_kind = 'google') AS \"sources!\"\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "title!",
- "type_info": "Text"
- },
- {
- "ordinal": 1,
- "name": "occurrences!",
- "type_info": "Int8"
- },
- {
- "ordinal": 2,
- "name": "sources!",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- null,
- null,
- null
- ]
- },
- "hash": "5f3465c9fc4de01bd3f5625f973b36d04c60756d551cf3283e72f930820212e7"
-}
diff --git a/.sqlx/query-5f9e7585eb577e5078ec97258f650dc5014688de2f1e1f7cc666895aee59cfa0.json b/.sqlx/query-5f9e7585eb577e5078ec97258f650dc5014688de2f1e1f7cc666895aee59cfa0.json
deleted file mode 100644
index 89ab941a64..0000000000
--- a/.sqlx/query-5f9e7585eb577e5078ec97258f650dc5014688de2f1e1f7cc666895aee59cfa0.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO ai_usage (id, feature, user_id, model, input_tokens, output_tokens)\n VALUES ($1, 'chat', $2, 'legacy-model', 1000000, 1000000)",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "5f9e7585eb577e5078ec97258f650dc5014688de2f1e1f7cc666895aee59cfa0"
-}
diff --git a/.sqlx/query-6024c12e588ebafc6003c0c003f042457a3ff3dbd83da2c22073c848cf21990a.json b/.sqlx/query-6024c12e588ebafc6003c0c003f042457a3ff3dbd83da2c22073c848cf21990a.json
deleted file mode 100644
index 100186d5a5..0000000000
--- a/.sqlx/query-6024c12e588ebafc6003c0c003f042457a3ff3dbd83da2c22073c848cf21990a.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE calendars SET synced_at=now(),materialized_starts_at='2026-07-01',materialized_ends_at='2026-08-01',materialized_start_date='2026-07-01',materialized_end_date='2026-08-01' WHERE account_id=$1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "6024c12e588ebafc6003c0c003f042457a3ff3dbd83da2c22073c848cf21990a"
-}
diff --git a/.sqlx/query-61f112ac14be228793a81deb0a0bc6b88234ed5758a17953d5a3c5cf23b2a76b.json b/.sqlx/query-61f112ac14be228793a81deb0a0bc6b88234ed5758a17953d5a3c5cf23b2a76b.json
deleted file mode 100644
index 5702554978..0000000000
--- a/.sqlx/query-61f112ac14be228793a81deb0a0bc6b88234ed5758a17953d5a3c5cf23b2a76b.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO calendar_backfill_jobs (\n id, email_link_id, kind, grant_version, status\n )\n VALUES ($1, $2, 'google_calendar', 1, 'pending')\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "61f112ac14be228793a81deb0a0bc6b88234ed5758a17953d5a3c5cf23b2a76b"
-}
diff --git a/.sqlx/query-62904494eba0dd7207fa568280deae7eb1212e330a30ea701967fb90e4bf7c36.json b/.sqlx/query-62904494eba0dd7207fa568280deae7eb1212e330a30ea701967fb90e4bf7c36.json
deleted file mode 100644
index 99a8de9f7c..0000000000
--- a/.sqlx/query-62904494eba0dd7207fa568280deae7eb1212e330a30ea701967fb90e4bf7c36.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE calendars SET sync_token = 'old-token', synced_at = now() WHERE id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "62904494eba0dd7207fa568280deae7eb1212e330a30ea701967fb90e4bf7c36"
-}
diff --git a/.sqlx/query-6324a86788fa01ce25e2440f0ae0bdeb160386e08a08a7b9d388eaeceb79b081.json b/.sqlx/query-6324a86788fa01ce25e2440f0ae0bdeb160386e08a08a7b9d388eaeceb79b081.json
deleted file mode 100644
index e7b35a8d08..0000000000
--- a/.sqlx/query-6324a86788fa01ce25e2440f0ae0bdeb160386e08a08a7b9d388eaeceb79b081.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE calendar_event_occurrences SET starts_at=$2,ends_at=$3,start_date=$4,end_date=$4 WHERE event_id=$1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Timestamptz",
- "Timestamptz",
- "Date"
- ]
- },
- "nullable": []
- },
- "hash": "6324a86788fa01ce25e2440f0ae0bdeb160386e08a08a7b9d388eaeceb79b081"
-}
diff --git a/.sqlx/query-639a5fa6d94f204324811e82dd37ebe6d39b2f83f33b1dbc21b0654113338e50.json b/.sqlx/query-639a5fa6d94f204324811e82dd37ebe6d39b2f83f33b1dbc21b0654113338e50.json
deleted file mode 100644
index 86ef49b05c..0000000000
--- a/.sqlx/query-639a5fa6d94f204324811e82dd37ebe6d39b2f83f33b1dbc21b0654113338e50.json
+++ /dev/null
@@ -1,23 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT title FROM calendar_event_sources WHERE event_id = $1 AND calendar_id = $2",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "title",
- "type_info": "Text"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid",
- "Uuid"
- ]
- },
- "nullable": [
- false
- ]
- },
- "hash": "639a5fa6d94f204324811e82dd37ebe6d39b2f83f33b1dbc21b0654113338e50"
-}
diff --git a/.sqlx/query-6892f4c0b364dc0e872a5b2f7d25f810f250f0c6538ba2ba5039028cff7cb0c9.json b/.sqlx/query-6892f4c0b364dc0e872a5b2f7d25f810f250f0c6538ba2ba5039028cff7cb0c9.json
deleted file mode 100644
index 3f401b9c86..0000000000
--- a/.sqlx/query-6892f4c0b364dc0e872a5b2f7d25f810f250f0c6538ba2ba5039028cff7cb0c9.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT status::text AS \"status!\" FROM ai_credit_reload WHERE stripe_invoice_id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "status!",
- "type_info": "Text"
- }
- ],
- "parameters": {
- "Left": [
- "Text"
- ]
- },
- "nullable": [
- null
- ]
- },
- "hash": "6892f4c0b364dc0e872a5b2f7d25f810f250f0c6538ba2ba5039028cff7cb0c9"
-}
diff --git a/.sqlx/query-6a3b43433310b498c8eb24ebf0870ff6017a7491c1f0491d75c56735977812a3.json b/.sqlx/query-6a3b43433310b498c8eb24ebf0870ff6017a7491c1f0491d75c56735977812a3.json
deleted file mode 100644
index 19323b7bf6..0000000000
--- a/.sqlx/query-6a3b43433310b498c8eb24ebf0870ff6017a7491c1f0491d75c56735977812a3.json
+++ /dev/null
@@ -1,24 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT user_id FROM ai_billing_usage_period WHERE user_id = ANY($1)\n AND policy = 'public_allowance_v1' AND period_start < $3 AND period_end > $2",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "user_id",
- "type_info": "Text"
- }
- ],
- "parameters": {
- "Left": [
- "TextArray",
- "Timestamptz",
- "Timestamptz"
- ]
- },
- "nullable": [
- false
- ]
- },
- "hash": "6a3b43433310b498c8eb24ebf0870ff6017a7491c1f0491d75c56735977812a3"
-}
diff --git a/.sqlx/query-7461c824736b6cf927c3b8ad03aa6212bca7e5ca60b57da2038a8b0d15d87601.json b/.sqlx/query-7461c824736b6cf927c3b8ad03aa6212bca7e5ca60b57da2038a8b0d15d87601.json
deleted file mode 100644
index a0bbefae5c..0000000000
--- a/.sqlx/query-7461c824736b6cf927c3b8ad03aa6212bca7e5ca60b57da2038a8b0d15d87601.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE ai_usage SET created_at = $2 WHERE id = (SELECT id FROM ai_usage WHERE user_id = $1 ORDER BY created_at DESC, id DESC LIMIT 1)",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Text",
- "Timestamptz"
- ]
- },
- "nullable": []
- },
- "hash": "7461c824736b6cf927c3b8ad03aa6212bca7e5ca60b57da2038a8b0d15d87601"
-}
diff --git a/.sqlx/query-7469c3291a182cf35af872cc36c7bd1eab4e940fc56f6c8bb5b7b61685ee4c66.json b/.sqlx/query-7469c3291a182cf35af872cc36c7bd1eab4e940fc56f6c8bb5b7b61685ee4c66.json
deleted file mode 100644
index 7d1ebe02d6..0000000000
--- a/.sqlx/query-7469c3291a182cf35af872cc36c7bd1eab4e940fc56f6c8bb5b7b61685ee4c66.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE email_links SET updated_at = $2 WHERE id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Timestamptz"
- ]
- },
- "nullable": []
- },
- "hash": "7469c3291a182cf35af872cc36c7bd1eab4e940fc56f6c8bb5b7b61685ee4c66"
-}
diff --git a/.sqlx/query-78075ab1bd6765213dde800c9533bb0f9d0c4f9b7792a8bb5a4f881c5d324b58.json b/.sqlx/query-78075ab1bd6765213dde800c9533bb0f9d0c4f9b7792a8bb5a4f881c5d324b58.json
deleted file mode 100644
index 40ebdb5968..0000000000
--- a/.sqlx/query-78075ab1bd6765213dde800c9533bb0f9d0c4f9b7792a8bb5a4f881c5d324b58.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "DELETE FROM team_user WHERE user_id=$1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "78075ab1bd6765213dde800c9533bb0f9d0c4f9b7792a8bb5a4f881c5d324b58"
-}
diff --git a/.sqlx/query-786dd4d53269c55a1865fedd231901cff70a3fe3a814eaeb3883e038e53c086e.json b/.sqlx/query-786dd4d53269c55a1865fedd231901cff70a3fe3a814eaeb3883e038e53c086e.json
deleted file mode 100644
index 417b14c176..0000000000
--- a/.sqlx/query-786dd4d53269c55a1865fedd231901cff70a3fe3a814eaeb3883e038e53c086e.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO ai_overage_charge (id, user_id, period_start, amount_cents, status, accounting_policy)\n VALUES ($1, $2, $3, 105, 'paid', 'public_allowance_v1')",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text",
- "Timestamptz"
- ]
- },
- "nullable": []
- },
- "hash": "786dd4d53269c55a1865fedd231901cff70a3fe3a814eaeb3883e038e53c086e"
-}
diff --git a/.sqlx/query-79ca419032c3b6ad11766f3fee3dcaf7efae6f0205ff91ffe81557c6573bf0ba.json b/.sqlx/query-79ca419032c3b6ad11766f3fee3dcaf7efae6f0205ff91ffe81557c6573bf0ba.json
deleted file mode 100644
index 4e0e60fc3c..0000000000
--- a/.sqlx/query-79ca419032c3b6ad11766f3fee3dcaf7efae6f0205ff91ffe81557c6573bf0ba.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE calendars SET sync_token='keep-token', synced_at=now(), materialized_starts_at='2026-07-01', materialized_ends_at='2026-08-01', materialized_start_date='2026-07-01', materialized_end_date='2026-08-01' WHERE id=$1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "79ca419032c3b6ad11766f3fee3dcaf7efae6f0205ff91ffe81557c6573bf0ba"
-}
diff --git a/.sqlx/query-7d095cecaa0bd15f4fda597b795b24af5ac726593918e2e3f04f458c30e6ee77.json b/.sqlx/query-7d095cecaa0bd15f4fda597b795b24af5ac726593918e2e3f04f458c30e6ee77.json
deleted file mode 100644
index 27051ac468..0000000000
--- a/.sqlx/query-7d095cecaa0bd15f4fda597b795b24af5ac726593918e2e3f04f458c30e6ee77.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE calendar_accounts SET sync_status='ready',last_synced_at=now() WHERE id=$1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "7d095cecaa0bd15f4fda597b795b24af5ac726593918e2e3f04f458c30e6ee77"
-}
diff --git a/.sqlx/query-7df7e6ffaab6df69c19b2a295bba31f7cc43ddc8323a4db715e726bf9d21b864.json b/.sqlx/query-7df7e6ffaab6df69c19b2a295bba31f7cc43ddc8323a4db715e726bf9d21b864.json
deleted file mode 100644
index 183e9037a5..0000000000
--- a/.sqlx/query-7df7e6ffaab6df69c19b2a295bba31f7cc43ddc8323a4db715e726bf9d21b864.json
+++ /dev/null
@@ -1,28 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT status, lease_token\n FROM calendar_backfill_jobs\n WHERE id = $1\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "status",
- "type_info": "Text"
- },
- {
- "ordinal": 1,
- "name": "lease_token",
- "type_info": "Uuid"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- false,
- true
- ]
- },
- "hash": "7df7e6ffaab6df69c19b2a295bba31f7cc43ddc8323a4db715e726bf9d21b864"
-}
diff --git a/.sqlx/query-85228310ed99c234c9541676f99c0e94d3fbf11473978471a6c52459f6a8ed28.json b/.sqlx/query-85228310ed99c234c9541676f99c0e94d3fbf11473978471a6c52459f6a8ed28.json
deleted file mode 100644
index 4027eb1e45..0000000000
--- a/.sqlx/query-85228310ed99c234c9541676f99c0e94d3fbf11473978471a6c52459f6a8ed28.json
+++ /dev/null
@@ -1,123 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT requested.entity_id AS \"requested_id!\",\n requested.entity_type AS \"requested_type!\",\n matched.notification_id AS \"notification_id!\",\n matched.event_item_id AS \"event_item_id!\",\n matched.event_item_type AS \"event_item_type!\",\n matched.notification_event_type AS \"notification_event_type!\",\n matched.sent AS \"sent!\",\n matched.state AS \"state!: NotificationState\",\n matched.created_at AS \"created_at!\",\n matched.viewed_at,\n matched.notification_metadata,\n matched.sender_id\n FROM unnest($2::text[], $3::text[]) requested(entity_id, entity_type)\n CROSS JOIN LATERAL (\n SELECT un.notification_id, n.event_item_id, n.event_item_type,\n n.notification_event_type, un.sent, un.state,\n un.created_at::timestamptz AS created_at,\n un.seen_at::timestamptz AS viewed_at,\n n.metadata AS notification_metadata, n.sender_id\n FROM (\n SELECT n.id FROM notification n\n WHERE n.event_item_id = requested.entity_id AND n.event_item_type = requested.entity_type\n UNION\n SELECT n.id FROM notification n\n WHERE n.secondary_event_item_id = requested.entity_id AND n.secondary_event_item_type = requested.entity_type\n UNION\n SELECT n.id FROM notification n\n WHERE requested.entity_type = 'channel_message'\n AND COALESCE(n.metadata->>'messageId', n.metadata->>'message_id', '') = requested.entity_id\n ) candidates\n JOIN notification n ON n.id = candidates.id\n JOIN user_notification un ON un.notification_id = n.id\n WHERE un.user_id = $1\n AND un.deleted_at IS NULL\n AND un.state = ANY($4::notification_state[])\n AND (cardinality($5::text[]) = 0 OR n.notification_event_type = ANY($5))\n AND (NOT $7::bool OR (\n n.notification_event_type IN ('channel_message_send', 'channel_mention', 'document_mention')\n AND COALESCE(n.metadata->>'threadId', n.metadata->>'thread_id') IS NULL\n ))\n ORDER BY un.created_at DESC, un.notification_id DESC\n LIMIT $6\n ) matched\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "requested_id!",
- "type_info": "Text"
- },
- {
- "ordinal": 1,
- "name": "requested_type!",
- "type_info": "Text"
- },
- {
- "ordinal": 2,
- "name": "notification_id!",
- "type_info": "Uuid"
- },
- {
- "ordinal": 3,
- "name": "event_item_id!",
- "type_info": "Text"
- },
- {
- "ordinal": 4,
- "name": "event_item_type!",
- "type_info": "Text"
- },
- {
- "ordinal": 5,
- "name": "notification_event_type!",
- "type_info": "Varchar"
- },
- {
- "ordinal": 6,
- "name": "sent!",
- "type_info": "Bool"
- },
- {
- "ordinal": 7,
- "name": "state!: NotificationState",
- "type_info": {
- "Custom": {
- "name": "notification_state",
- "kind": {
- "Enum": [
- "unseen",
- "seen",
- "done"
- ]
- }
- }
- }
- },
- {
- "ordinal": 8,
- "name": "created_at!",
- "type_info": "Timestamptz"
- },
- {
- "ordinal": 9,
- "name": "viewed_at",
- "type_info": "Timestamptz"
- },
- {
- "ordinal": 10,
- "name": "notification_metadata",
- "type_info": "Jsonb"
- },
- {
- "ordinal": 11,
- "name": "sender_id",
- "type_info": "Text"
- }
- ],
- "parameters": {
- "Left": [
- "Text",
- "TextArray",
- "TextArray",
- {
- "Custom": {
- "name": "notification_state[]",
- "kind": {
- "Array": {
- "Custom": {
- "name": "notification_state",
- "kind": {
- "Enum": [
- "unseen",
- "seen",
- "done"
- ]
- }
- }
- }
- }
- }
- },
- "TextArray",
- "Int8",
- "Bool"
- ]
- },
- "nullable": [
- null,
- null,
- false,
- false,
- false,
- false,
- false,
- false,
- null,
- null,
- false,
- true
- ]
- },
- "hash": "85228310ed99c234c9541676f99c0e94d3fbf11473978471a6c52459f6a8ed28"
-}
diff --git a/.sqlx/query-85491b3f376f100fa76950379e427e044606c4f50b0a5d3ee5909d0551079613.json b/.sqlx/query-85491b3f376f100fa76950379e427e044606c4f50b0a5d3ee5909d0551079613.json
deleted file mode 100644
index 97195370e0..0000000000
--- a/.sqlx/query-85491b3f376f100fa76950379e427e044606c4f50b0a5d3ee5909d0551079613.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT published_at FROM calendar_sync_outbox WHERE backfill_job_id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "published_at",
- "type_info": "Timestamptz"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- true
- ]
- },
- "hash": "85491b3f376f100fa76950379e427e044606c4f50b0a5d3ee5909d0551079613"
-}
diff --git a/.sqlx/query-8562a5a683259d3412c0d5cc58cc526dab7551296d96564fab4bdd44dbed43c5.json b/.sqlx/query-8562a5a683259d3412c0d5cc58cc526dab7551296d96564fab4bdd44dbed43c5.json
deleted file mode 100644
index 4f0279e537..0000000000
--- a/.sqlx/query-8562a5a683259d3412c0d5cc58cc526dab7551296d96564fab4bdd44dbed43c5.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO macro_user_links(primary_macro_id,child_macro_id,link_id) VALUES($1,$2,$3)",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Text",
- "Text",
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "8562a5a683259d3412c0d5cc58cc526dab7551296d96564fab4bdd44dbed43c5"
-}
diff --git a/.sqlx/query-8650d517d70e42d44b79ff07108b88215261a0d602d592bdc80cd73334dc3551.json b/.sqlx/query-8650d517d70e42d44b79ff07108b88215261a0d602d592bdc80cd73334dc3551.json
deleted file mode 100644
index 10cf31afbb..0000000000
--- a/.sqlx/query-8650d517d70e42d44b79ff07108b88215261a0d602d592bdc80cd73334dc3551.json
+++ /dev/null
@@ -1,34 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT sync_status,last_sync_error,last_synced_at FROM calendar_accounts WHERE id=$1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "sync_status",
- "type_info": "Text"
- },
- {
- "ordinal": 1,
- "name": "last_sync_error",
- "type_info": "Text"
- },
- {
- "ordinal": 2,
- "name": "last_synced_at",
- "type_info": "Timestamptz"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- false,
- true,
- true
- ]
- },
- "hash": "8650d517d70e42d44b79ff07108b88215261a0d602d592bdc80cd73334dc3551"
-}
diff --git a/.sqlx/query-86b8905de61002d7be77fd8ed1b411dd86157c409cd3c53d22794407d5bf7e76.json b/.sqlx/query-86b8905de61002d7be77fd8ed1b411dd86157c409cd3c53d22794407d5bf7e76.json
deleted file mode 100644
index 7c40a440bf..0000000000
--- a/.sqlx/query-86b8905de61002d7be77fd8ed1b411dd86157c409cd3c53d22794407d5bf7e76.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO ai_usage (id, feature, user_id, model, input_tokens, output_tokens,\n total, created_at, count_usage)\n VALUES ($1, 'chat', $2, 'test-model', 0, 0, 1.0, $3, $4)",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text",
- "Timestamptz",
- "Bool"
- ]
- },
- "nullable": []
- },
- "hash": "86b8905de61002d7be77fd8ed1b411dd86157c409cd3c53d22794407d5bf7e76"
-}
diff --git a/.sqlx/query-88e6765ad8271d0c4c3c1043a00b76f649018ec5b34293bd4391f3aae672c39c.json b/.sqlx/query-88e6765ad8271d0c4c3c1043a00b76f649018ec5b34293bd4391f3aae672c39c.json
deleted file mode 100644
index 9105dc7774..0000000000
--- a/.sqlx/query-88e6765ad8271d0c4c3c1043a00b76f649018ec5b34293bd4391f3aae672c39c.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "DELETE FROM macro_user_links WHERE primary_macro_id=$1 AND link_id=$2",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Text",
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "88e6765ad8271d0c4c3c1043a00b76f649018ec5b34293bd4391f3aae672c39c"
-}
diff --git a/.sqlx/query-8f2fa6e97f58f901103c09678bcb4be646c03cb3fa63be7b2e86e14628812df3.json b/.sqlx/query-8f2fa6e97f58f901103c09678bcb4be646c03cb3fa63be7b2e86e14628812df3.json
deleted file mode 100644
index 667dcf2bbc..0000000000
--- a/.sqlx/query-8f2fa6e97f58f901103c09678bcb4be646c03cb3fa63be7b2e86e14628812df3.json
+++ /dev/null
@@ -1,34 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT job.status, job.lease_token, outbox.published_at\n FROM calendar_backfill_jobs job\n JOIN calendar_sync_outbox outbox ON outbox.backfill_job_id = job.id\n WHERE job.id = $1\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "status",
- "type_info": "Text"
- },
- {
- "ordinal": 1,
- "name": "lease_token",
- "type_info": "Uuid"
- },
- {
- "ordinal": 2,
- "name": "published_at",
- "type_info": "Timestamptz"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- false,
- true,
- true
- ]
- },
- "hash": "8f2fa6e97f58f901103c09678bcb4be646c03cb3fa63be7b2e86e14628812df3"
-}
diff --git a/.sqlx/query-91371030c79e2a96270b623b963c87bafe771a13486bff84ead90b22f308f2a0.json b/.sqlx/query-91371030c79e2a96270b623b963c87bafe771a13486bff84ead90b22f308f2a0.json
deleted file mode 100644
index e166405d9a..0000000000
--- a/.sqlx/query-91371030c79e2a96270b623b963c87bafe771a13486bff84ead90b22f308f2a0.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT count(*) AS \"count!\" FROM calendar_events WHERE id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "count!",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- null
- ]
- },
- "hash": "91371030c79e2a96270b623b963c87bafe771a13486bff84ead90b22f308f2a0"
-}
diff --git a/.sqlx/query-93900b6249dc8886def225c9871cb6737ced49ffe8e72691b773ea128b4f52bc.json b/.sqlx/query-93900b6249dc8886def225c9871cb6737ced49ffe8e72691b773ea128b4f52bc.json
deleted file mode 100644
index b581b4e292..0000000000
--- a/.sqlx/query-93900b6249dc8886def225c9871cb6737ced49ffe8e72691b773ea128b4f52bc.json
+++ /dev/null
@@ -1,46 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT calendar.sync_token, calendar.synced_at, calendar.materialized_starts_at, source.provider_access_role, source.title FROM calendars calendar JOIN calendar_event_sources source ON source.calendar_id=calendar.id WHERE source.event_id=$1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "sync_token",
- "type_info": "Text"
- },
- {
- "ordinal": 1,
- "name": "synced_at",
- "type_info": "Timestamptz"
- },
- {
- "ordinal": 2,
- "name": "materialized_starts_at",
- "type_info": "Timestamptz"
- },
- {
- "ordinal": 3,
- "name": "provider_access_role",
- "type_info": "Text"
- },
- {
- "ordinal": 4,
- "name": "title",
- "type_info": "Text"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- true,
- true,
- true,
- true,
- false
- ]
- },
- "hash": "93900b6249dc8886def225c9871cb6737ced49ffe8e72691b773ea128b4f52bc"
-}
diff --git a/.sqlx/query-9431a8d5774a696946810c2bc1c68fc37192b42cf8b7d81ce0eba9b446cedfcb.json b/.sqlx/query-9431a8d5774a696946810c2bc1c68fc37192b42cf8b7d81ce0eba9b446cedfcb.json
deleted file mode 100644
index 03cff08e62..0000000000
--- a/.sqlx/query-9431a8d5774a696946810c2bc1c68fc37192b42cf8b7d81ce0eba9b446cedfcb.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO calendar_event_reminder_deliveries (\n id, event_id, occurrence_key, minutes_before, fire_at\n )\n VALUES ($1, $2, 'key', 10, now())\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "9431a8d5774a696946810c2bc1c68fc37192b42cf8b7d81ce0eba9b446cedfcb"
-}
diff --git a/.sqlx/query-9488ee6964d91adc899244314f268e409df4b474d99b458dae05fe134e11827c.json b/.sqlx/query-9488ee6964d91adc899244314f268e409df4b474d99b458dae05fe134e11827c.json
deleted file mode 100644
index 19f56b3efe..0000000000
--- a/.sqlx/query-9488ee6964d91adc899244314f268e409df4b474d99b458dae05fe134e11827c.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE calendar_accounts SET last_sync_error=NULL,last_synced_at=now()-interval '16 minutes' WHERE id=$1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "9488ee6964d91adc899244314f268e409df4b474d99b458dae05fe134e11827c"
-}
diff --git a/.sqlx/query-9670211667c01900383684234af23552d2895473c63b61e1cbb3dbb630ccdb27.json b/.sqlx/query-9670211667c01900383684234af23552d2895473c63b61e1cbb3dbb630ccdb27.json
deleted file mode 100644
index c62c021131..0000000000
--- a/.sqlx/query-9670211667c01900383684234af23552d2895473c63b61e1cbb3dbb630ccdb27.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE calendar_accounts SET sync_status='disabled' WHERE id=$1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "9670211667c01900383684234af23552d2895473c63b61e1cbb3dbb630ccdb27"
-}
diff --git a/.sqlx/query-97d88f069366a5b0ecf1ae8d4dd9aaff262513601f56b636ced612799b3e1958.json b/.sqlx/query-97d88f069366a5b0ecf1ae8d4dd9aaff262513601f56b636ced612799b3e1958.json
deleted file mode 100644
index d13027b155..0000000000
--- a/.sqlx/query-97d88f069366a5b0ecf1ae8d4dd9aaff262513601f56b636ced612799b3e1958.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO calendar_backfill_jobs (\n id, email_link_id, account_id, kind, grant_version, status\n )\n VALUES ($1, $2, $3, 'google_calendar', 1, 'pending')\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Uuid",
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "97d88f069366a5b0ecf1ae8d4dd9aaff262513601f56b636ced612799b3e1958"
-}
diff --git a/.sqlx/query-9b10ea76482f6b7050a46ecfce38203c1771809a581c80531bb99b78bba46c11.json b/.sqlx/query-9b10ea76482f6b7050a46ecfce38203c1771809a581c80531bb99b78bba46c11.json
deleted file mode 100644
index 0614e8a54b..0000000000
--- a/.sqlx/query-9b10ea76482f6b7050a46ecfce38203c1771809a581c80531bb99b78bba46c11.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT sync_token FROM calendars WHERE id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "sync_token",
- "type_info": "Text"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- true
- ]
- },
- "hash": "9b10ea76482f6b7050a46ecfce38203c1771809a581c80531bb99b78bba46c11"
-}
diff --git a/.sqlx/query-9d7b3c808b6a8786431fb21520308c90c3bb34d4ac49d7a0f337a751d2ae2211.json b/.sqlx/query-9d7b3c808b6a8786431fb21520308c90c3bb34d4ac49d7a0f337a751d2ae2211.json
deleted file mode 100644
index a6826f0a7a..0000000000
--- a/.sqlx/query-9d7b3c808b6a8786431fb21520308c90c3bb34d4ac49d7a0f337a751d2ae2211.json
+++ /dev/null
@@ -1,53 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT user_id, payer_id, subscription_id, period_start, period_end, policy FROM ai_billing_usage_period\n WHERE user_id = $1 AND period_start <= $2 AND period_end > $2",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "user_id",
- "type_info": "Text"
- },
- {
- "ordinal": 1,
- "name": "payer_id",
- "type_info": "Text"
- },
- {
- "ordinal": 2,
- "name": "subscription_id",
- "type_info": "Text"
- },
- {
- "ordinal": 3,
- "name": "period_start",
- "type_info": "Timestamptz"
- },
- {
- "ordinal": 4,
- "name": "period_end",
- "type_info": "Timestamptz"
- },
- {
- "ordinal": 5,
- "name": "policy",
- "type_info": "Text"
- }
- ],
- "parameters": {
- "Left": [
- "Text",
- "Timestamptz"
- ]
- },
- "nullable": [
- false,
- false,
- false,
- false,
- false,
- false
- ]
- },
- "hash": "9d7b3c808b6a8786431fb21520308c90c3bb34d4ac49d7a0f337a751d2ae2211"
-}
diff --git a/.sqlx/query-9da658a7d5907f15c324ab6c8587ba1203e33aa3539d9c82758148c4dbaeb238.json b/.sqlx/query-9da658a7d5907f15c324ab6c8587ba1203e33aa3539d9c82758148c4dbaeb238.json
deleted file mode 100644
index 203be4f048..0000000000
--- a/.sqlx/query-9da658a7d5907f15c324ab6c8587ba1203e33aa3539d9c82758148c4dbaeb238.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE calendars SET synced_at=now() WHERE id=$1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "9da658a7d5907f15c324ab6c8587ba1203e33aa3539d9c82758148c4dbaeb238"
-}
diff --git a/.sqlx/query-9e3e9a5ba74600ee544a3a930bf54da41abaed6e7d7695e7fac88b65c4a3361e.json b/.sqlx/query-9e3e9a5ba74600ee544a3a930bf54da41abaed6e7d7695e7fac88b65c4a3361e.json
deleted file mode 100644
index 4aff03b59d..0000000000
--- a/.sqlx/query-9e3e9a5ba74600ee544a3a930bf54da41abaed6e7d7695e7fac88b65c4a3361e.json
+++ /dev/null
@@ -1,46 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT\n l.macro_id,\n l.email_address::text AS \"email_address!\",\n COALESCE(g.granted_scopes, '{}') AS \"granted_scopes!\",\n COALESCE(g.grant_version, 0) AS \"grant_version!\",\n g.calendar_disabled_at\n FROM email_links l\n LEFT JOIN email_link_google_scopes g ON g.link_id = l.id\n WHERE l.id = $1\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "macro_id",
- "type_info": "Text"
- },
- {
- "ordinal": 1,
- "name": "email_address!",
- "type_info": "Text"
- },
- {
- "ordinal": 2,
- "name": "granted_scopes!",
- "type_info": "TextArray"
- },
- {
- "ordinal": 3,
- "name": "grant_version!",
- "type_info": "Int8"
- },
- {
- "ordinal": 4,
- "name": "calendar_disabled_at",
- "type_info": "Timestamptz"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- false,
- null,
- null,
- null,
- true
- ]
- },
- "hash": "9e3e9a5ba74600ee544a3a930bf54da41abaed6e7d7695e7fac88b65c4a3361e"
-}
diff --git a/.sqlx/query-9e79198b97dd65b615bdf975fd82c175a75e283465907f992e09983da30953bf.json b/.sqlx/query-9e79198b97dd65b615bdf975fd82c175a75e283465907f992e09983da30953bf.json
new file mode 100644
index 0000000000..62fb065963
--- /dev/null
+++ b/.sqlx/query-9e79198b97dd65b615bdf975fd82c175a75e283465907f992e09983da30953bf.json
@@ -0,0 +1,143 @@
+{
+ "db_name": "PostgreSQL",
+ "query": "\n WITH requested AS (\n SELECT entity_id, entity_type\n FROM unnest($2::text[], $3::text[]) AS entities(entity_id, entity_type)\n ),\n -- Scope uses all active notifications, not just the requested states: a\n -- seen reply still assigns an unseen root send to its thread row.\n -- Build scope evidence once per batch, never rescan history per send.\n channel_scopes AS MATERIALIZED (\n SELECT DISTINCT n.event_item_id AS channel_id,\n CASE WHEN n.notification_event_type = 'channel_mention'\n THEN COALESCE(n.metadata->>'messageId', n.metadata->>'message_id')\n END AS mentioned_message_id,\n COALESCE(n.metadata->>'threadId', n.metadata->>'thread_id') AS thread_id\n FROM requested\n JOIN notification n\n ON n.event_item_id = requested.entity_id AND n.event_item_type = 'channel'\n JOIN user_notification un ON un.notification_id = n.id\n WHERE $8::bool AND requested.entity_type = 'channel'\n AND un.user_id = $1 AND un.deleted_at IS NULL\n AND un.state = ANY($9::notification_state[])\n AND n.notification_event_type IN ('channel_mention', 'channel_message_reply')\n )\n SELECT requested.entity_id AS \"requested_id!\",\n requested.entity_type AS \"requested_type!\",\n matched.notification_id AS \"notification_id!\",\n matched.event_item_id AS \"event_item_id!\",\n matched.event_item_type AS \"event_item_type!\",\n matched.notification_event_type AS \"notification_event_type!\",\n matched.sent AS \"sent!\",\n matched.state AS \"state!: NotificationState\",\n matched.created_at AS \"created_at!\",\n matched.viewed_at,\n matched.notification_metadata,\n matched.sender_id\n FROM requested\n CROSS JOIN LATERAL (\n SELECT un.notification_id, n.event_item_id, n.event_item_type,\n n.notification_event_type, un.sent, un.state,\n un.created_at::timestamptz AS created_at,\n un.seen_at::timestamptz AS viewed_at,\n n.metadata AS notification_metadata, n.sender_id\n FROM (\n SELECT n.id FROM notification n\n WHERE n.event_item_id = requested.entity_id AND n.event_item_type = requested.entity_type\n UNION\n SELECT n.id FROM notification n\n WHERE n.secondary_event_item_id = requested.entity_id AND n.secondary_event_item_type = requested.entity_type\n UNION\n SELECT n.id FROM notification n\n WHERE requested.entity_type = 'channel_message'\n AND COALESCE(n.metadata->>'messageId', n.metadata->>'message_id', '') = requested.entity_id\n ) candidates\n JOIN notification n ON n.id = candidates.id\n JOIN user_notification un ON un.notification_id = n.id\n WHERE un.user_id = $1\n AND un.deleted_at IS NULL\n AND un.state = ANY($4::notification_state[])\n AND (cardinality($5::text[]) = 0 OR n.notification_event_type = ANY($5))\n AND (NOT $7::bool OR (\n n.notification_event_type IN ('channel_message_send', 'channel_mention', 'document_mention')\n AND COALESCE(n.metadata->>'threadId', n.metadata->>'thread_id') IS NULL\n ))\n AND (NOT $8::bool OR requested.entity_type <> 'channel' OR (\n n.notification_event_type = 'document_mention'\n OR (n.notification_event_type IN ('channel_message_send', 'channel_message_reply') AND (\n -- Mention stacks consume the mention, not its duplicate send/reply.\n EXISTS (\n SELECT 1 FROM channel_scopes scope\n WHERE scope.channel_id = n.event_item_id\n AND scope.mentioned_message_id = COALESCE(n.metadata->>'messageId', n.metadata->>'message_id')\n )\n OR (n.notification_event_type = 'channel_message_send' AND NOT EXISTS (\n SELECT 1 FROM channel_scopes scope\n WHERE scope.channel_id = n.event_item_id AND scope.thread_id <> ''\n AND scope.thread_id = COALESCE(n.metadata->>'messageId', n.metadata->>'message_id')\n ))\n OR (n.notification_event_type = 'channel_message_reply'\n AND NULLIF(COALESCE(n.metadata->>'threadId', n.metadata->>'thread_id'), '') IS NULL)\n ))\n OR (n.notification_event_type = 'channel_mention' AND (\n COALESCE(n.metadata->>'threadId', n.metadata->>'thread_id') = ''\n OR (COALESCE(n.metadata->>'threadId', n.metadata->>'thread_id') IS NULL\n AND COALESCE(n.metadata->>'messageId', n.metadata->>'message_id') = ''\n AND EXISTS (SELECT 1 FROM channel_scopes scope\n WHERE scope.channel_id = n.event_item_id AND scope.thread_id = ''))\n ))\n ))\n ORDER BY un.created_at DESC, un.notification_id DESC\n LIMIT $6\n ) matched\n ",
+ "describe": {
+ "columns": [
+ {
+ "ordinal": 0,
+ "name": "requested_id!",
+ "type_info": "Text"
+ },
+ {
+ "ordinal": 1,
+ "name": "requested_type!",
+ "type_info": "Text"
+ },
+ {
+ "ordinal": 2,
+ "name": "notification_id!",
+ "type_info": "Uuid"
+ },
+ {
+ "ordinal": 3,
+ "name": "event_item_id!",
+ "type_info": "Text"
+ },
+ {
+ "ordinal": 4,
+ "name": "event_item_type!",
+ "type_info": "Text"
+ },
+ {
+ "ordinal": 5,
+ "name": "notification_event_type!",
+ "type_info": "Varchar"
+ },
+ {
+ "ordinal": 6,
+ "name": "sent!",
+ "type_info": "Bool"
+ },
+ {
+ "ordinal": 7,
+ "name": "state!: NotificationState",
+ "type_info": {
+ "Custom": {
+ "name": "notification_state",
+ "kind": {
+ "Enum": [
+ "unseen",
+ "seen",
+ "done"
+ ]
+ }
+ }
+ }
+ },
+ {
+ "ordinal": 8,
+ "name": "created_at!",
+ "type_info": "Timestamptz"
+ },
+ {
+ "ordinal": 9,
+ "name": "viewed_at",
+ "type_info": "Timestamptz"
+ },
+ {
+ "ordinal": 10,
+ "name": "notification_metadata",
+ "type_info": "Jsonb"
+ },
+ {
+ "ordinal": 11,
+ "name": "sender_id",
+ "type_info": "Text"
+ }
+ ],
+ "parameters": {
+ "Left": [
+ "Text",
+ "TextArray",
+ "TextArray",
+ {
+ "Custom": {
+ "name": "notification_state[]",
+ "kind": {
+ "Array": {
+ "Custom": {
+ "name": "notification_state",
+ "kind": {
+ "Enum": [
+ "unseen",
+ "seen",
+ "done"
+ ]
+ }
+ }
+ }
+ }
+ }
+ },
+ "TextArray",
+ "Int8",
+ "Bool",
+ "Bool",
+ {
+ "Custom": {
+ "name": "notification_state[]",
+ "kind": {
+ "Array": {
+ "Custom": {
+ "name": "notification_state",
+ "kind": {
+ "Enum": [
+ "unseen",
+ "seen",
+ "done"
+ ]
+ }
+ }
+ }
+ }
+ }
+ }
+ ]
+ },
+ "nullable": [
+ null,
+ null,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ null,
+ null,
+ false,
+ true
+ ]
+ },
+ "hash": "9e79198b97dd65b615bdf975fd82c175a75e283465907f992e09983da30953bf"
+}
diff --git a/.sqlx/query-a3f970587e572b50b2760c191d83bc1845a4c1d1d9f7c926855fa8dee6690810.json b/.sqlx/query-a3f970587e572b50b2760c191d83bc1845a4c1d1d9f7c926855fa8dee6690810.json
deleted file mode 100644
index cc1f8f09e3..0000000000
--- a/.sqlx/query-a3f970587e572b50b2760c191d83bc1845a4c1d1d9f7c926855fa8dee6690810.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE calendar_backfill_jobs SET updated_at = now() - interval '30 minutes' WHERE id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "a3f970587e572b50b2760c191d83bc1845a4c1d1d9f7c926855fa8dee6690810"
-}
diff --git a/.sqlx/query-a47ae61afdc43746d37172689c2d7ba6c5a02d90dde6f19aef371ab1d6ef997c.json b/.sqlx/query-a47ae61afdc43746d37172689c2d7ba6c5a02d90dde6f19aef371ab1d6ef997c.json
deleted file mode 100644
index 1a5cfeb467..0000000000
--- a/.sqlx/query-a47ae61afdc43746d37172689c2d7ba6c5a02d90dde6f19aef371ab1d6ef997c.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "DELETE FROM team_user WHERE team_id = $1 AND user_id = $2",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "a47ae61afdc43746d37172689c2d7ba6c5a02d90dde6f19aef371ab1d6ef997c"
-}
diff --git a/.sqlx/query-a59419c189f7d54eaeb4dfde64f4ca7f7eeff827d9865bd5566772a2c1b60276.json b/.sqlx/query-a59419c189f7d54eaeb4dfde64f4ca7f7eeff827d9865bd5566772a2c1b60276.json
deleted file mode 100644
index 2c3d6128ed..0000000000
--- a/.sqlx/query-a59419c189f7d54eaeb4dfde64f4ca7f7eeff827d9865bd5566772a2c1b60276.json
+++ /dev/null
@@ -1,28 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT title,\n (SELECT count(*) FROM calendar_event_sources WHERE event_id = $1) AS \"source_count!\"\n FROM calendar_events\n WHERE id = $1\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "title",
- "type_info": "Text"
- },
- {
- "ordinal": 1,
- "name": "source_count!",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- false,
- null
- ]
- },
- "hash": "a59419c189f7d54eaeb4dfde64f4ca7f7eeff827d9865bd5566772a2c1b60276"
-}
diff --git a/.sqlx/query-a7e5ec2e4ad17eb542f4a5c5b0328bcf9fabb4835a641d02f307279ff26af8de.json b/.sqlx/query-a7e5ec2e4ad17eb542f4a5c5b0328bcf9fabb4835a641d02f307279ff26af8de.json
deleted file mode 100644
index 7c0b2b82fb..0000000000
--- a/.sqlx/query-a7e5ec2e4ad17eb542f4a5c5b0328bcf9fabb4835a641d02f307279ff26af8de.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT provider_access_role FROM calendar_event_sources WHERE id=$1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "provider_access_role",
- "type_info": "Text"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- true
- ]
- },
- "hash": "a7e5ec2e4ad17eb542f4a5c5b0328bcf9fabb4835a641d02f307279ff26af8de"
-}
diff --git a/.sqlx/query-ab92e3babbad2d74b9f47db60cf48c301df2ca353b76e7dbd9170adfaa21031d.json b/.sqlx/query-ab92e3babbad2d74b9f47db60cf48c301df2ca353b76e7dbd9170adfaa21031d.json
deleted file mode 100644
index 6753227c63..0000000000
--- a/.sqlx/query-ab92e3babbad2d74b9f47db60cf48c301df2ca353b76e7dbd9170adfaa21031d.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE calendar_change_log SET created_at = now() - interval '40 days' WHERE link_id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "ab92e3babbad2d74b9f47db60cf48c301df2ca353b76e7dbd9170adfaa21031d"
-}
diff --git a/.sqlx/query-acd569257805385d6626989e4056a23ef16e173539005e42642a7d457f698abc.json b/.sqlx/query-acd569257805385d6626989e4056a23ef16e173539005e42642a7d457f698abc.json
deleted file mode 100644
index 6eccf8e27f..0000000000
--- a/.sqlx/query-acd569257805385d6626989e4056a23ef16e173539005e42642a7d457f698abc.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT seq FROM calendar_change_counters WHERE link_id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "seq",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- false
- ]
- },
- "hash": "acd569257805385d6626989e4056a23ef16e173539005e42642a7d457f698abc"
-}
diff --git a/.sqlx/query-ad3282ea97b12bd71d1d6330d7e59aaf8df87e6dad7a52c12d143f03d573b757.json b/.sqlx/query-ad3282ea97b12bd71d1d6330d7e59aaf8df87e6dad7a52c12d143f03d573b757.json
deleted file mode 100644
index fb2840ec1e..0000000000
--- a/.sqlx/query-ad3282ea97b12bd71d1d6330d7e59aaf8df87e6dad7a52c12d143f03d573b757.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE calendar_accounts SET sync_status = 'disabled' WHERE email_link_id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "ad3282ea97b12bd71d1d6330d7e59aaf8df87e6dad7a52c12d143f03d573b757"
-}
diff --git a/.sqlx/query-ae3debae48c69dd06757b4f8c07a5940485944f7b47ea47a49562ee7ca162848.json b/.sqlx/query-ae3debae48c69dd06757b4f8c07a5940485944f7b47ea47a49562ee7ca162848.json
deleted file mode 100644
index 9f12e10ab2..0000000000
--- a/.sqlx/query-ae3debae48c69dd06757b4f8c07a5940485944f7b47ea47a49562ee7ca162848.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE calendars SET snapshot_normalization_version=0 WHERE account_id=$1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "ae3debae48c69dd06757b4f8c07a5940485944f7b47ea47a49562ee7ca162848"
-}
diff --git a/.sqlx/query-afed14d65b93dc016921f0c3842f0ed3546a051fdefc397e0130e5617148d7d9.json b/.sqlx/query-afed14d65b93dc016921f0c3842f0ed3546a051fdefc397e0130e5617148d7d9.json
deleted file mode 100644
index 70a75d59f9..0000000000
--- a/.sqlx/query-afed14d65b93dc016921f0c3842f0ed3546a051fdefc397e0130e5617148d7d9.json
+++ /dev/null
@@ -1,40 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT\n job.status AS job_status,\n account.sync_status AS account_status,\n link.needs_reauth,\n link.last_sync_error_at\n FROM calendar_backfill_jobs job\n JOIN calendar_accounts account ON account.id = job.account_id\n JOIN email_links link ON link.id = job.email_link_id\n WHERE job.id = $1\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "job_status",
- "type_info": "Text"
- },
- {
- "ordinal": 1,
- "name": "account_status",
- "type_info": "Text"
- },
- {
- "ordinal": 2,
- "name": "needs_reauth",
- "type_info": "Bool"
- },
- {
- "ordinal": 3,
- "name": "last_sync_error_at",
- "type_info": "Timestamptz"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- false,
- false,
- false,
- true
- ]
- },
- "hash": "afed14d65b93dc016921f0c3842f0ed3546a051fdefc397e0130e5617148d7d9"
-}
diff --git a/.sqlx/query-b213c1e58d762fa44747443ae41e18e1fc8007787953838822a0f46005bfbd6d.json b/.sqlx/query-b213c1e58d762fa44747443ae41e18e1fc8007787953838822a0f46005bfbd6d.json
deleted file mode 100644
index 88e749a69f..0000000000
--- a/.sqlx/query-b213c1e58d762fa44747443ae41e18e1fc8007787953838822a0f46005bfbd6d.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE calendar_backfill_jobs SET lease_expires_at = now() - interval '20 minutes' WHERE id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "b213c1e58d762fa44747443ae41e18e1fc8007787953838822a0f46005bfbd6d"
-}
diff --git a/.sqlx/query-b37f4a45679755c7321b5209cc0c53726df450e36b3532008e9d6a0943f26603.json b/.sqlx/query-b37f4a45679755c7321b5209cc0c53726df450e36b3532008e9d6a0943f26603.json
deleted file mode 100644
index 5c35a73b72..0000000000
--- a/.sqlx/query-b37f4a45679755c7321b5209cc0c53726df450e36b3532008e9d6a0943f26603.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT sync_status FROM calendar_accounts WHERE id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "sync_status",
- "type_info": "Text"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- false
- ]
- },
- "hash": "b37f4a45679755c7321b5209cc0c53726df450e36b3532008e9d6a0943f26603"
-}
diff --git a/.sqlx/query-b4231a071d13eae93e1349628ec9a214027d0df707513c20cc70f3f9aa75b01b.json b/.sqlx/query-b4231a071d13eae93e1349628ec9a214027d0df707513c20cc70f3f9aa75b01b.json
deleted file mode 100644
index 5b80a39283..0000000000
--- a/.sqlx/query-b4231a071d13eae93e1349628ec9a214027d0df707513c20cc70f3f9aa75b01b.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n UPDATE calendar_accounts\n SET last_synced_at = now() - interval '10 minutes'\n WHERE id = $1\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "b4231a071d13eae93e1349628ec9a214027d0df707513c20cc70f3f9aa75b01b"
-}
diff --git a/.sqlx/query-b9931658292b2c291424844093c49f4ee11a78c3f0c48b06683723ff9ad99508.json b/.sqlx/query-b9931658292b2c291424844093c49f4ee11a78c3f0c48b06683723ff9ad99508.json
deleted file mode 100644
index 916a218a70..0000000000
--- a/.sqlx/query-b9931658292b2c291424844093c49f4ee11a78c3f0c48b06683723ff9ad99508.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE calendar_event_sources SET provider_access_role = NULL WHERE event_id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "b9931658292b2c291424844093c49f4ee11a78c3f0c48b06683723ff9ad99508"
-}
diff --git a/.sqlx/query-bb0a0eadde401cbb1f34fa45b1806392cbbfd0c6cfd2ee247d7748059171d7ee.json b/.sqlx/query-bb0a0eadde401cbb1f34fa45b1806392cbbfd0c6cfd2ee247d7748059171d7ee.json
deleted file mode 100644
index 2d270ad421..0000000000
--- a/.sqlx/query-bb0a0eadde401cbb1f34fa45b1806392cbbfd0c6cfd2ee247d7748059171d7ee.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO foreign_entity (id, foreign_entity_id, foreign_entity_source, metadata, stored_for_id, stored_for_auth_entity) VALUES ($1, 'macro/app/pull/7', 'github_pull_request', '{}', $2, $3)",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "bb0a0eadde401cbb1f34fa45b1806392cbbfd0c6cfd2ee247d7748059171d7ee"
-}
diff --git a/.sqlx/query-bd37a33a82a494a2fe668169d07d22ea805b30ffd34e53c9407b0ed04ee43654.json b/.sqlx/query-bd37a33a82a494a2fe668169d07d22ea805b30ffd34e53c9407b0ed04ee43654.json
deleted file mode 100644
index 9c45666aca..0000000000
--- a/.sqlx/query-bd37a33a82a494a2fe668169d07d22ea805b30ffd34e53c9407b0ed04ee43654.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO comms_channel_participants (channel_id, user_id, role) VALUES ($1, $2, 'member')",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "bd37a33a82a494a2fe668169d07d22ea805b30ffd34e53c9407b0ed04ee43654"
-}
diff --git a/.sqlx/query-be31a5baca5e5f0265f9987bdaf230238454be9fa8cd0135c5892f297d3b0c50.json b/.sqlx/query-be31a5baca5e5f0265f9987bdaf230238454be9fa8cd0135c5892f297d3b0c50.json
deleted file mode 100644
index 2a3d110c2a..0000000000
--- a/.sqlx/query-be31a5baca5e5f0265f9987bdaf230238454be9fa8cd0135c5892f297d3b0c50.json
+++ /dev/null
@@ -1,28 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT\n (SELECT count(*) FROM calendar_events WHERE id = $1) AS \"event_count!\",\n (SELECT count(*) FROM calendar_event_sources WHERE event_id = $1) AS \"source_count!\"\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "event_count!",
- "type_info": "Int8"
- },
- {
- "ordinal": 1,
- "name": "source_count!",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- null,
- null
- ]
- },
- "hash": "be31a5baca5e5f0265f9987bdaf230238454be9fa8cd0135c5892f297d3b0c50"
-}
diff --git a/.sqlx/query-c01ca10561801578ddc5ca42f62f3cad73c845e381c7222168d8c2beab3cdd2e.json b/.sqlx/query-c01ca10561801578ddc5ca42f62f3cad73c845e381c7222168d8c2beab3cdd2e.json
deleted file mode 100644
index 68a2d42cf9..0000000000
--- a/.sqlx/query-c01ca10561801578ddc5ca42f62f3cad73c845e381c7222168d8c2beab3cdd2e.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE calendars SET access_role = 'writer' WHERE id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "c01ca10561801578ddc5ca42f62f3cad73c845e381c7222168d8c2beab3cdd2e"
-}
diff --git a/.sqlx/query-c101454ec5644bd0e219cc112b975205f73c5e2853ee4ad5e213249fb5c2aee5.json b/.sqlx/query-c101454ec5644bd0e219cc112b975205f73c5e2853ee4ad5e213249fb5c2aee5.json
deleted file mode 100644
index d95d326220..0000000000
--- a/.sqlx/query-c101454ec5644bd0e219cc112b975205f73c5e2853ee4ad5e213249fb5c2aee5.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE calendar_event_overrides SET starts_at=$2,ends_at=$3,start_date=$4,end_date=$4 WHERE event_id=$1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Timestamptz",
- "Timestamptz",
- "Date"
- ]
- },
- "nullable": []
- },
- "hash": "c101454ec5644bd0e219cc112b975205f73c5e2853ee4ad5e213249fb5c2aee5"
-}
diff --git a/.sqlx/query-c2034a09d94daac82338267149c38feeb656b6e7aab9747d400dd6f3ad686c5a.json b/.sqlx/query-c2034a09d94daac82338267149c38feeb656b6e7aab9747d400dd6f3ad686c5a.json
deleted file mode 100644
index 706a0acfcb..0000000000
--- a/.sqlx/query-c2034a09d94daac82338267149c38feeb656b6e7aab9747d400dd6f3ad686c5a.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO ai_credit_ledger (id, user_id, kind, delta_cents, stripe_reference, note)\n VALUES ($1, $2, 'purchase', $3, $4, 'Automatic reload')\n ON CONFLICT (stripe_reference) WHERE stripe_reference IS NOT NULL DO NOTHING\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text",
- "Int8",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "c2034a09d94daac82338267149c38feeb656b6e7aab9747d400dd6f3ad686c5a"
-}
diff --git a/.sqlx/query-c24c56dc8063f9c911e9d839dbea07785d609f3edadb5853cafec4944f83dd40.json b/.sqlx/query-c24c56dc8063f9c911e9d839dbea07785d609f3edadb5853cafec4944f83dd40.json
deleted file mode 100644
index 84f13fefc0..0000000000
--- a/.sqlx/query-c24c56dc8063f9c911e9d839dbea07785d609f3edadb5853cafec4944f83dd40.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE calendar_events SET starts_at=$2,ends_at=$3,start_date=$4,end_date=$4 WHERE id=$1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Timestamptz",
- "Timestamptz",
- "Date"
- ]
- },
- "nullable": []
- },
- "hash": "c24c56dc8063f9c911e9d839dbea07785d609f3edadb5853cafec4944f83dd40"
-}
diff --git a/.sqlx/query-c465c86774a284bbc52cd251fc869d61520e0b29e58a73d21bfc138e6e8c29cc.json b/.sqlx/query-c465c86774a284bbc52cd251fc869d61520e0b29e58a73d21bfc138e6e8c29cc.json
deleted file mode 100644
index f7317cb4c5..0000000000
--- a/.sqlx/query-c465c86774a284bbc52cd251fc869d61520e0b29e58a73d21bfc138e6e8c29cc.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT count(*) AS \"count!\"\n FROM calendar_events\n WHERE owner_id = $1\n AND ical_uid = '[email protected]'\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "count!",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": [
- "Text"
- ]
- },
- "nullable": [
- null
- ]
- },
- "hash": "c465c86774a284bbc52cd251fc869d61520e0b29e58a73d21bfc138e6e8c29cc"
-}
diff --git a/.sqlx/query-c607a885b975f97c31292631a354ff4f0b83210d1849bcf0901651469242d6ec.json b/.sqlx/query-c607a885b975f97c31292631a354ff4f0b83210d1849bcf0901651469242d6ec.json
deleted file mode 100644
index 72cd4fc950..0000000000
--- a/.sqlx/query-c607a885b975f97c31292631a354ff4f0b83210d1849bcf0901651469242d6ec.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n UPDATE calendar_backfill_jobs\n SET lease_expires_at = now() - interval '1 second'\n WHERE id = $1\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "c607a885b975f97c31292631a354ff4f0b83210d1849bcf0901651469242d6ec"
-}
diff --git a/.sqlx/query-cc20f902b9d7bbba6c10722be138edf3841aca4bbe8f1994a249430a388cb6d1.json b/.sqlx/query-cc20f902b9d7bbba6c10722be138edf3841aca4bbe8f1994a249430a388cb6d1.json
deleted file mode 100644
index 1ccf9a0ff2..0000000000
--- a/.sqlx/query-cc20f902b9d7bbba6c10722be138edf3841aca4bbe8f1994a249430a388cb6d1.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO ai_billing_usage_period (user_id, payer_id, subscription_id, period_start, period_end, policy) VALUES ($1, $1, 'sub_test', $2, $3, 'public_allowance_v1')",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Text",
- "Timestamptz",
- "Timestamptz"
- ]
- },
- "nullable": []
- },
- "hash": "cc20f902b9d7bbba6c10722be138edf3841aca4bbe8f1994a249430a388cb6d1"
-}
diff --git a/.sqlx/query-cd478841e1611f4d25a337ae745091e4bee407a73708b784395e38133e00ee72.json b/.sqlx/query-cd478841e1611f4d25a337ae745091e4bee407a73708b784395e38133e00ee72.json
deleted file mode 100644
index 4de8e6b36a..0000000000
--- a/.sqlx/query-cd478841e1611f4d25a337ae745091e4bee407a73708b784395e38133e00ee72.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT count(*) AS \"count!\" FROM calendar_events WHERE owner_id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "count!",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": [
- "Text"
- ]
- },
- "nullable": [
- null
- ]
- },
- "hash": "cd478841e1611f4d25a337ae745091e4bee407a73708b784395e38133e00ee72"
-}
diff --git a/.sqlx/query-cd9f3727ba0ddd65fd1de9ab8cab0c8b085ab3b3731446ada9a761bd9e008b5d.json b/.sqlx/query-cd9f3727ba0ddd65fd1de9ab8cab0c8b085ab3b3731446ada9a761bd9e008b5d.json
deleted file mode 100644
index afe534ea30..0000000000
--- a/.sqlx/query-cd9f3727ba0ddd65fd1de9ab8cab0c8b085ab3b3731446ada9a761bd9e008b5d.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO email_link_google_scopes (link_id, granted_scopes, grant_version)\n VALUES ($1, $2, $3)\n ON CONFLICT (link_id) DO UPDATE\n SET granted_scopes = EXCLUDED.granted_scopes,\n grant_version = EXCLUDED.grant_version,\n updated_at = now()\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "TextArray",
- "Int8"
- ]
- },
- "nullable": []
- },
- "hash": "cd9f3727ba0ddd65fd1de9ab8cab0c8b085ab3b3731446ada9a761bd9e008b5d"
-}
diff --git a/.sqlx/query-cec2290034dfc1eb6b928b4241895d106c8dc8d5ef51a4acd361eade3692b8ad.json b/.sqlx/query-cec2290034dfc1eb6b928b4241895d106c8dc8d5ef51a4acd361eade3692b8ad.json
deleted file mode 100644
index f7b0af1412..0000000000
--- a/.sqlx/query-cec2290034dfc1eb6b928b4241895d106c8dc8d5ef51a4acd361eade3692b8ad.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE calendars SET access_role = 'reader', synced_at = now() WHERE id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "cec2290034dfc1eb6b928b4241895d106c8dc8d5ef51a4acd361eade3692b8ad"
-}
diff --git a/.sqlx/query-d224fec1fc8eaa6bc13b523178367e1df94ebb30c2c91900356489f17bab3e50.json b/.sqlx/query-d224fec1fc8eaa6bc13b523178367e1df94ebb30c2c91900356489f17bab3e50.json
deleted file mode 100644
index 79887a0bcb..0000000000
--- a/.sqlx/query-d224fec1fc8eaa6bc13b523178367e1df94ebb30c2c91900356489f17bab3e50.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE calendar_sync_outbox SET published_at = now() - interval '30 minutes' WHERE backfill_job_id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "d224fec1fc8eaa6bc13b523178367e1df94ebb30c2c91900356489f17bab3e50"
-}
diff --git a/.sqlx/query-d2f4f0047dc35fa1fa49e851a3693afce63ea36e15797fb97d80629a9e56030e.json b/.sqlx/query-d2f4f0047dc35fa1fa49e851a3693afce63ea36e15797fb97d80629a9e56030e.json
deleted file mode 100644
index 2a80439c97..0000000000
--- a/.sqlx/query-d2f4f0047dc35fa1fa49e851a3693afce63ea36e15797fb97d80629a9e56030e.json
+++ /dev/null
@@ -1,28 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT account.sync_status, link.needs_reauth\n FROM calendar_accounts account\n JOIN email_links link ON link.id = account.email_link_id\n WHERE account.id = $1\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "sync_status",
- "type_info": "Text"
- },
- {
- "ordinal": 1,
- "name": "needs_reauth",
- "type_info": "Bool"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- false,
- false
- ]
- },
- "hash": "d2f4f0047dc35fa1fa49e851a3693afce63ea36e15797fb97d80629a9e56030e"
-}
diff --git a/.sqlx/query-d5d483fa9a3fd3d6e8cf519d259dc78cf5a9e5aa0920b944969964501f2fb728.json b/.sqlx/query-d5d483fa9a3fd3d6e8cf519d259dc78cf5a9e5aa0920b944969964501f2fb728.json
deleted file mode 100644
index 07d59b4860..0000000000
--- a/.sqlx/query-d5d483fa9a3fd3d6e8cf519d259dc78cf5a9e5aa0920b944969964501f2fb728.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE calendars SET access_role = 'reader' WHERE id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "d5d483fa9a3fd3d6e8cf519d259dc78cf5a9e5aa0920b944969964501f2fb728"
-}
diff --git a/.sqlx/query-d6c9b446490cccb56361011d8d87a4d8cf6cd383abbb39ab45db1d5b5b6645f9.json b/.sqlx/query-d6c9b446490cccb56361011d8d87a4d8cf6cd383abbb39ab45db1d5b5b6645f9.json
deleted file mode 100644
index e6a7abe5f4..0000000000
--- a/.sqlx/query-d6c9b446490cccb56361011d8d87a4d8cf6cd383abbb39ab45db1d5b5b6645f9.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE calendars SET snapshot_normalization_version=1 WHERE id=$1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "d6c9b446490cccb56361011d8d87a4d8cf6cd383abbb39ab45db1d5b5b6645f9"
-}
diff --git a/.sqlx/query-d81a0f98a2299337971e33f3299709237742b6be8c777181f54e2c056d9c3491.json b/.sqlx/query-d81a0f98a2299337971e33f3299709237742b6be8c777181f54e2c056d9c3491.json
deleted file mode 100644
index 43dbb6e867..0000000000
--- a/.sqlx/query-d81a0f98a2299337971e33f3299709237742b6be8c777181f54e2c056d9c3491.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT COUNT(*) FROM ai_billing_usage_observation",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "count",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": []
- },
- "nullable": [
- null
- ]
- },
- "hash": "d81a0f98a2299337971e33f3299709237742b6be8c777181f54e2c056d9c3491"
-}
diff --git a/.sqlx/query-e14a1cdd414be53099d0765b82256730865aaa0ba9a1f9e272851a0ca778e6c8.json b/.sqlx/query-e14a1cdd414be53099d0765b82256730865aaa0ba9a1f9e272851a0ca778e6c8.json
deleted file mode 100644
index 4792defcb2..0000000000
--- a/.sqlx/query-e14a1cdd414be53099d0765b82256730865aaa0ba9a1f9e272851a0ca778e6c8.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "ALTER TABLE ai_credit_ledger ADD CONSTRAINT reject_test_reload\n CHECK (stripe_reference <> 'in_retry')",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": []
- },
- "nullable": []
- },
- "hash": "e14a1cdd414be53099d0765b82256730865aaa0ba9a1f9e272851a0ca778e6c8"
-}
diff --git a/.sqlx/query-e18bdb73d69d37ea32745f55c613dc74c98c82cfd7c7bf32cd683b160823e8ac.json b/.sqlx/query-e18bdb73d69d37ea32745f55c613dc74c98c82cfd7c7bf32cd683b160823e8ac.json
deleted file mode 100644
index fb7ff9f34d..0000000000
--- a/.sqlx/query-e18bdb73d69d37ea32745f55c613dc74c98c82cfd7c7bf32cd683b160823e8ac.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO comms_channels (id, channel_type, owner_id) VALUES ($1, 'private', $2)",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "e18bdb73d69d37ea32745f55c613dc74c98c82cfd7c7bf32cd683b160823e8ac"
-}
diff --git a/.sqlx/query-e2e897244504a70648f99e3273a2b1dae62cd13c2bd642d31dfbdc4dcef65101.json b/.sqlx/query-e2e897244504a70648f99e3273a2b1dae62cd13c2bd642d31dfbdc4dcef65101.json
deleted file mode 100644
index 946e24c10c..0000000000
--- a/.sqlx/query-e2e897244504a70648f99e3273a2b1dae62cd13c2bd642d31dfbdc4dcef65101.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT status FROM calendar_backfill_jobs WHERE id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "status",
- "type_info": "Text"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- false
- ]
- },
- "hash": "e2e897244504a70648f99e3273a2b1dae62cd13c2bd642d31dfbdc4dcef65101"
-}
diff --git a/.sqlx/query-e35afcf3f15eeaa81c9caf8fdae2e7bbac901d5b7549ffd52b81ab1892f1e916.json b/.sqlx/query-e35afcf3f15eeaa81c9caf8fdae2e7bbac901d5b7549ffd52b81ab1892f1e916.json
deleted file mode 100644
index f30bfbcce2..0000000000
--- a/.sqlx/query-e35afcf3f15eeaa81c9caf8fdae2e7bbac901d5b7549ffd52b81ab1892f1e916.json
+++ /dev/null
@@ -1,28 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT granted_scopes, (calendar_disabled_at IS NOT NULL) AS \"opted_out!\"\n FROM email_link_google_scopes WHERE link_id = $1\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "granted_scopes",
- "type_info": "TextArray"
- },
- {
- "ordinal": 1,
- "name": "opted_out!",
- "type_info": "Bool"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- false,
- null
- ]
- },
- "hash": "e35afcf3f15eeaa81c9caf8fdae2e7bbac901d5b7549ffd52b81ab1892f1e916"
-}
diff --git a/.sqlx/query-e67fda05dacea7a0b6290e8b69932ad27e5a0dd128af9273d1d6179e60f9ea0b.json b/.sqlx/query-e67fda05dacea7a0b6290e8b69932ad27e5a0dd128af9273d1d6179e60f9ea0b.json
deleted file mode 100644
index 82f38da2f6..0000000000
--- a/.sqlx/query-e67fda05dacea7a0b6290e8b69932ad27e5a0dd128af9273d1d6179e60f9ea0b.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SET TRANSACTION ISOLATION LEVEL REPEATABLE READ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": []
- },
- "nullable": []
- },
- "hash": "e67fda05dacea7a0b6290e8b69932ad27e5a0dd128af9273d1d6179e60f9ea0b"
-}
diff --git a/.sqlx/query-e89cf7546c3aa6739811ef59282d928ddac771af6143dd331c6ff7122990145e.json b/.sqlx/query-e89cf7546c3aa6739811ef59282d928ddac771af6143dd331c6ff7122990145e.json
deleted file mode 100644
index 2a64486cd7..0000000000
--- a/.sqlx/query-e89cf7546c3aa6739811ef59282d928ddac771af6143dd331c6ff7122990145e.json
+++ /dev/null
@@ -1,34 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT title, description, provider_access_role FROM calendar_event_sources WHERE event_id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "title",
- "type_info": "Text"
- },
- {
- "ordinal": 1,
- "name": "description",
- "type_info": "Text"
- },
- {
- "ordinal": 2,
- "name": "provider_access_role",
- "type_info": "Text"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- false,
- true,
- true
- ]
- },
- "hash": "e89cf7546c3aa6739811ef59282d928ddac771af6143dd331c6ff7122990145e"
-}
diff --git a/.sqlx/query-ea9699f158d8430269b28e8d986ae4f453b335df009b120fc9a38925da14fd7e.json b/.sqlx/query-ea9699f158d8430269b28e8d986ae4f453b335df009b120fc9a38925da14fd7e.json
deleted file mode 100644
index 60c19ecd69..0000000000
--- a/.sqlx/query-ea9699f158d8430269b28e8d986ae4f453b335df009b120fc9a38925da14fd7e.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO subscription_plan_schedule (id, subscription_id, effective_at, member_plans) VALUES ($1, 'sub_team', $2, $3)",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Timestamptz",
- "Jsonb"
- ]
- },
- "nullable": []
- },
- "hash": "ea9699f158d8430269b28e8d986ae4f453b335df009b120fc9a38925da14fd7e"
-}
diff --git a/.sqlx/query-edaea28192b00cb0886f13d5fabbc39e475970abae720c14424bb3d94cea362d.json b/.sqlx/query-edaea28192b00cb0886f13d5fabbc39e475970abae720c14424bb3d94cea362d.json
deleted file mode 100644
index 195c6b87bb..0000000000
--- a/.sqlx/query-edaea28192b00cb0886f13d5fabbc39e475970abae720c14424bb3d94cea362d.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE calendars SET last_sync_error=$2,snapshot_normalization_version=$3 WHERE id=$1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text",
- "Int4"
- ]
- },
- "nullable": []
- },
- "hash": "edaea28192b00cb0886f13d5fabbc39e475970abae720c14424bb3d94cea362d"
-}
diff --git a/.sqlx/query-f1cc2af79f3b8088623953af157d62cf79a1a8deabdeb17b8c6dae489c2917fc.json b/.sqlx/query-f1cc2af79f3b8088623953af157d62cf79a1a8deabdeb17b8c6dae489c2917fc.json
deleted file mode 100644
index c8e87c6892..0000000000
--- a/.sqlx/query-f1cc2af79f3b8088623953af157d62cf79a1a8deabdeb17b8c6dae489c2917fc.json
+++ /dev/null
@@ -1,34 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT occurrence_key, minutes_before, fire_at\n FROM calendar_event_reminder_firings\n WHERE event_id = $1\n ORDER BY fire_at, minutes_before\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "occurrence_key",
- "type_info": "Text"
- },
- {
- "ordinal": 1,
- "name": "minutes_before",
- "type_info": "Int4"
- },
- {
- "ordinal": 2,
- "name": "fire_at",
- "type_info": "Timestamptz"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- false,
- false,
- false
- ]
- },
- "hash": "f1cc2af79f3b8088623953af157d62cf79a1a8deabdeb17b8c6dae489c2917fc"
-}
diff --git a/.sqlx/query-f1db2512e038a8e0e29fa95227ca9540c61a539b8d2986cba1bb42259d113006.json b/.sqlx/query-f1db2512e038a8e0e29fa95227ca9540c61a539b8d2986cba1bb42259d113006.json
deleted file mode 100644
index 01750344c8..0000000000
--- a/.sqlx/query-f1db2512e038a8e0e29fa95227ca9540c61a539b8d2986cba1bb42259d113006.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT is_deleted AS \"is_deleted!\" FROM calendars WHERE id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "is_deleted!",
- "type_info": "Bool"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- false
- ]
- },
- "hash": "f1db2512e038a8e0e29fa95227ca9540c61a539b8d2986cba1bb42259d113006"
-}
diff --git a/.sqlx/query-f2dcd3ac39e87492a62691d87a12e92fcacb72f447475742f1f71c7ce817d2ee.json b/.sqlx/query-f2dcd3ac39e87492a62691d87a12e92fcacb72f447475742f1f71c7ce817d2ee.json
deleted file mode 100644
index c773a0061c..0000000000
--- a/.sqlx/query-f2dcd3ac39e87492a62691d87a12e92fcacb72f447475742f1f71c7ce817d2ee.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO team_user(user_id,team_id,team_role) VALUES($1,$2,'member')",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Text",
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "f2dcd3ac39e87492a62691d87a12e92fcacb72f447475742f1f71c7ce817d2ee"
-}
diff --git a/.sqlx/query-f301b9913cdf0bac23f3ae299fa85013d82038c7610a45f0035877031f2ff69c.json b/.sqlx/query-f301b9913cdf0bac23f3ae299fa85013d82038c7610a45f0035877031f2ff69c.json
deleted file mode 100644
index e2bd39dd34..0000000000
--- a/.sqlx/query-f301b9913cdf0bac23f3ae299fa85013d82038c7610a45f0035877031f2ff69c.json
+++ /dev/null
@@ -1,40 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT seq, kind, event_id, calendar_id\n FROM calendar_change_log\n WHERE link_id = $1\n ORDER BY seq\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "seq",
- "type_info": "Int8"
- },
- {
- "ordinal": 1,
- "name": "kind",
- "type_info": "Int2"
- },
- {
- "ordinal": 2,
- "name": "event_id",
- "type_info": "Uuid"
- },
- {
- "ordinal": 3,
- "name": "calendar_id",
- "type_info": "Uuid"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- false,
- false,
- true,
- true
- ]
- },
- "hash": "f301b9913cdf0bac23f3ae299fa85013d82038c7610a45f0035877031f2ff69c"
-}
diff --git a/.sqlx/query-f400e52fd81e057c31a80c0bb4f4835481bf9952c8e4518d927f05212457585c.json b/.sqlx/query-f400e52fd81e057c31a80c0bb4f4835481bf9952c8e4518d927f05212457585c.json
deleted file mode 100644
index ab57db9444..0000000000
--- a/.sqlx/query-f400e52fd81e057c31a80c0bb4f4835481bf9952c8e4518d927f05212457585c.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO \"User\" (id, email, macro_user_id)\n VALUES ($1, $2, $3)\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Text",
- "Text",
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "f400e52fd81e057c31a80c0bb4f4835481bf9952c8e4518d927f05212457585c"
-}
diff --git a/.sqlx/query-f551e38b0818512f71bfa817b48835410d809622c26c6f8bf238eccc60454089.json b/.sqlx/query-f551e38b0818512f71bfa817b48835410d809622c26c6f8bf238eccc60454089.json
deleted file mode 100644
index 32f5fae4d2..0000000000
--- a/.sqlx/query-f551e38b0818512f71bfa817b48835410d809622c26c6f8bf238eccc60454089.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO email_links (\n id, macro_id, fusionauth_user_id, email_address, provider\n )\n VALUES ($1, $2, $2, $3, 'GMAIL')\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text",
- "Varchar"
- ]
- },
- "nullable": []
- },
- "hash": "f551e38b0818512f71bfa817b48835410d809622c26c6f8bf238eccc60454089"
-}
diff --git a/.sqlx/query-f6992f796a1c21b672fd36d7eeaa592486d24b773775d26865ff64d4831447d6.json b/.sqlx/query-f6992f796a1c21b672fd36d7eeaa592486d24b773775d26865ff64d4831447d6.json
deleted file mode 100644
index 1fabb12b7e..0000000000
--- a/.sqlx/query-f6992f796a1c21b672fd36d7eeaa592486d24b773775d26865ff64d4831447d6.json
+++ /dev/null
@@ -1,28 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT title, provider_access_role FROM calendar_event_sources WHERE event_id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "title",
- "type_info": "Text"
- },
- {
- "ordinal": 1,
- "name": "provider_access_role",
- "type_info": "Text"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- false,
- true
- ]
- },
- "hash": "f6992f796a1c21b672fd36d7eeaa592486d24b773775d26865ff64d4831447d6"
-}
diff --git a/.sqlx/query-faf4e7eeb01e297390c6d77e3f4e4b2aebd90c7f4c75342ed92bd3dd5a2ffb7b.json b/.sqlx/query-faf4e7eeb01e297390c6d77e3f4e4b2aebd90c7f4c75342ed92bd3dd5a2ffb7b.json
deleted file mode 100644
index c147db315b..0000000000
--- a/.sqlx/query-faf4e7eeb01e297390c6d77e3f4e4b2aebd90c7f4c75342ed92bd3dd5a2ffb7b.json
+++ /dev/null
@@ -1,40 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT calendar.sync_token, calendar.synced_at, calendar.materialized_starts_at, source.provider_access_role FROM calendars calendar JOIN calendar_event_sources source ON source.calendar_id = calendar.id WHERE source.event_id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "sync_token",
- "type_info": "Text"
- },
- {
- "ordinal": 1,
- "name": "synced_at",
- "type_info": "Timestamptz"
- },
- {
- "ordinal": 2,
- "name": "materialized_starts_at",
- "type_info": "Timestamptz"
- },
- {
- "ordinal": 3,
- "name": "provider_access_role",
- "type_info": "Text"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- true,
- true,
- true,
- true
- ]
- },
- "hash": "faf4e7eeb01e297390c6d77e3f4e4b2aebd90c7f4c75342ed92bd3dd5a2ffb7b"
-}
diff --git a/.sqlx/query-fd0d9b58f20c4bfc60af79e891b9ffdd72c072b119822dffc73acb88221fc65a.json b/.sqlx/query-fd0d9b58f20c4bfc60af79e891b9ffdd72c072b119822dffc73acb88221fc65a.json
deleted file mode 100644
index cec53fe0f7..0000000000
--- a/.sqlx/query-fd0d9b58f20c4bfc60af79e891b9ffdd72c072b119822dffc73acb88221fc65a.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT max(generated_at) AS \"max!\" FROM calendar_event_occurrences WHERE event_id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "max!",
- "type_info": "Timestamptz"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- null
- ]
- },
- "hash": "fd0d9b58f20c4bfc60af79e891b9ffdd72c072b119822dffc73acb88221fc65a"
-}
diff --git a/.sqlx/query-fd36eb70805edee5f09027ab688337222f62cdba931937ad3a5989a43a3ad47f.json b/.sqlx/query-fd36eb70805edee5f09027ab688337222f62cdba931937ad3a5989a43a3ad47f.json
deleted file mode 100644
index 8be07d3b6d..0000000000
--- a/.sqlx/query-fd36eb70805edee5f09027ab688337222f62cdba931937ad3a5989a43a3ad47f.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE calendar_change_log SET created_at = now() - interval '40 days' WHERE link_id = $1 AND seq <= 2",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "fd36eb70805edee5f09027ab688337222f62cdba931937ad3a5989a43a3ad47f"
-}
diff --git a/.sqlx/query-fd3fb1e2ffd254f9bbfb7ab02584152267a70f0f4eb8b37d3434231c4e003d46.json b/.sqlx/query-fd3fb1e2ffd254f9bbfb7ab02584152267a70f0f4eb8b37d3434231c4e003d46.json
deleted file mode 100644
index 398b0b8121..0000000000
--- a/.sqlx/query-fd3fb1e2ffd254f9bbfb7ab02584152267a70f0f4eb8b37d3434231c4e003d46.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE calendar_sync_outbox SET published_at = now() WHERE backfill_job_id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "fd3fb1e2ffd254f9bbfb7ab02584152267a70f0f4eb8b37d3434231c4e003d46"
-}
diff --git a/.sqlx/query-fda562d30ca57ca7b5b112f2414f38f809e78207c82ed1fb32fcb01ef7864433.json b/.sqlx/query-fda562d30ca57ca7b5b112f2414f38f809e78207c82ed1fb32fcb01ef7864433.json
deleted file mode 100644
index ad01379f13..0000000000
--- a/.sqlx/query-fda562d30ca57ca7b5b112f2414f38f809e78207c82ed1fb32fcb01ef7864433.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE comms_channel_participants SET left_at = now() WHERE channel_id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "fda562d30ca57ca7b5b112f2414f38f809e78207c82ed1fb32fcb01ef7864433"
-}
diff --git a/apps/web/src/components/app/sidebar-next/queries/use-sidebar-unread.test.ts b/apps/web/src/components/app/sidebar-next/queries/use-sidebar-unread.test.ts
index d509cff247..5ebdebac7c 100644
--- a/apps/web/src/components/app/sidebar-next/queries/use-sidebar-unread.test.ts
+++ b/apps/web/src/components/app/sidebar-next/queries/use-sidebar-unread.test.ts
@@ -26,8 +26,8 @@ vi.mock('@queries/channel/unread-presence', () => ({
vi.mock('@app/features/email-view/queries/email-query', () => ({
buildEmailQuery: () => ({ params: {}, body: {} }),
}));
-vi.mock('@app/features/home/queries/use-home-query', () => ({
- useHomeEntitiesQuery: mocks.home,
+vi.mock('@app/features/home/queries/use-home-unread-query', () => ({
+ useHomeUnreadQuery: mocks.home,
}));
vi.mock('@queries/soup/items', () => ({
useSoupAstItemsQuery: mocks.email,
@@ -124,11 +124,9 @@ function setup(graphql = false) {
mocks.hasUnreadEntity.mockImplementation((items: EmailEntity[]) =>
items.some((item) => !item.done && !item.isRead)
);
- mocks.home.mockReturnValue({
- query,
- hasUnreadEntity: mocks.hasUnreadEntity,
- transformEntities: mocks.transformEntities,
- });
+ mocks.home.mockReturnValue(() =>
+ loading() ? false : mocks.hasUnreadEntity(emails())
+ );
mocks.email.mockReturnValue(query);
mocks.notifications.mockImplementation(notifications);
return {
@@ -151,10 +149,8 @@ describe('sidebar unread presence', () => {
}
expect(mocks.hasUnreadEntity).not.toHaveBeenCalled();
expect(mocks.transformEntities).not.toHaveBeenCalled();
- expect(mocks.home).toHaveBeenCalledWith({
- tab: 'signal',
- facets: { read: ['unread'] },
- });
+ expect(mocks.home).toHaveBeenCalledWith(expect.any(Function));
+ expect(mocks.home.mock.calls[0][0]()).toBe(false);
});
it('reacts to read, unread, and done changes in loaded rows', () => {
diff --git a/apps/web/src/components/app/sidebar-next/queries/use-sidebar-unread.ts b/apps/web/src/components/app/sidebar-next/queries/use-sidebar-unread.ts
index f9b362aa27..f9760964f5 100644
--- a/apps/web/src/components/app/sidebar-next/queries/use-sidebar-unread.ts
+++ b/apps/web/src/components/app/sidebar-next/queries/use-sidebar-unread.ts
@@ -1,6 +1,6 @@
import { buildEmailQuery } from '@app/features/email-view/queries/email-query';
import { soupItemMatchesHomeTab } from '@app/features/home/queries/home-item-filter';
-import { useHomeEntitiesQuery } from '@app/features/home/queries/use-home-query';
+import { useHomeUnreadQuery } from '@app/features/home/queries/use-home-unread-query';
import {
compileToAst,
defineQueryFilters,
@@ -44,10 +44,7 @@ export function useSidebarUnread() {
}),
() => graphqlFlag().enabled
);
- const home = useHomeEntitiesQuery({
- tab: 'signal',
- facets: { read: ['unread'] },
- });
+ const homeUnread = useHomeUnreadQuery(() => graphqlFlag().enabled);
const email = useSoupAstItemsQuery(
() =>
buildEmailQuery({
@@ -63,10 +60,6 @@ export function useSidebarUnread() {
// Guard resource reads so loading a badge cannot suspend the app shell.
// Re-check cached rows: optimistic read/done changes can leave them in a page.
- const homeUnread = createMemo(() => {
- if (home.query.isLoading) return false;
- return home.hasUnreadEntity(home.query.data?.entities ?? []);
- });
const emailUnread = createMemo(() => {
if (email.isLoading) return false;
return (email.data?.entities ?? []).some(
diff --git a/apps/web/src/features/home/queries/home-unread.test.ts b/apps/web/src/features/home/queries/home-unread.test.ts
new file mode 100644
index 0000000000..251170acbe
--- /dev/null
+++ b/apps/web/src/features/home/queries/home-unread.test.ts
@@ -0,0 +1,186 @@
+import type { NotificationSource } from '@notifications/notification-source';
+import type { HomeUnreadPresenceQuery } from '@service-storage/graphql/generated/graphql';
+import { beforeEach, describe, expect, it, vi } from 'vitest';
+import type { HomeQueryCapabilities } from './home-query';
+import { hasHomeUnreadWitness } from './home-unread';
+
+const flags = vi.hoisted(() => ({ clientEmailSignal: false }));
+vi.mock('@core/constant/featureFlags', () => ({
+ get ENABLE_CLIENT_EMAIL_SIGNAL_FILTER() {
+ return flags.clientEmailSignal;
+ },
+}));
+
+type Item = HomeUnreadPresenceQuery['user']['soup']['items'][number];
+type Email = Extract<Item, { __typename: 'GraphqlSoupEmailThread' }>;
+const now = new Date('2026-10-13T12:00:00Z');
+const capabilities: HomeQueryCapabilities = {
+ calendar: true,
+ foreignEntities: true,
+ snippets: true,
+ notifiedSort: false,
+};
+const base = {
+ id: 'entity',
+ metadata: {
+ __typename: 'GraphqlEntityMetadata' as const,
+ createdAt: now.toISOString(),
+ updatedAt: now.toISOString(),
+ },
+ unreadNotifications: [
+ {
+ __typename: 'GraphqlNotification' as const,
+ id: 'witness',
+ state: 'UNSEEN' as const,
+ },
+ ],
+};
+const channel: Item = { ...base, __typename: 'GraphqlSoupChannel' };
+const email: Email = {
+ ...base,
+ __typename: 'GraphqlSoupEmailThread',
+ isRead: false,
+ inboxVisible: true,
+ isDraft: false,
+ sortTs: now.toISOString(),
+ labels: [],
+ unreadReminders: [],
+};
+const hasUnread = (
+ items: Item[],
+ source: Pick<NotificationSource, 'withLocalState'> = {},
+ caps = capabilities
+) => hasHomeUnreadWitness(items, caps, source, now);
+
+beforeEach(() => {
+ flags.clientEmailSignal = false;
+});
+
+describe('Home bounded unread witnesses', () => {
+ it('uses state-only witnesses and preserves local seen/done overrides', () => {
+ expect(hasUnread([channel])).toBe(true);
+ expect(hasUnread([{ ...channel, unreadNotifications: [] }])).toBe(false);
+ for (const state of ['seen', 'done'] as const) {
+ expect(hasUnread([channel], { withLocalState: () => state })).toBe(false);
+ }
+ expect(hasUnread([channel], { withLocalState: () => 'unseen' })).toBe(true);
+ expect(
+ hasUnread([
+ {
+ ...channel,
+ unreadNotifications: [
+ { ...base.unreadNotifications[0], state: 'SEEN' },
+ ],
+ },
+ ])
+ ).toBe(false);
+ });
+
+ it('stops at the first unread entity, without loading full notification metadata', () => {
+ const withLocalState = vi.fn(({ state }) => state);
+ expect(
+ hasUnread(
+ Array.from({ length: 100 }, (_, i) => ({ ...channel, id: String(i) })),
+ { withLocalState }
+ )
+ ).toBe(true);
+ expect(withLocalState).toHaveBeenCalledExactlyOnceWith({
+ id: 'witness',
+ state: 'unseen',
+ });
+ });
+
+ it('uses mailbox read/archive state independently from notification presence', () => {
+ expect(hasUnread([{ ...email, unreadNotifications: [] }])).toBe(true);
+ expect(hasUnread([{ ...email, isRead: true }])).toBe(false);
+ expect(hasUnread([{ ...email, inboxVisible: false }])).toBe(false);
+ expect(
+ hasUnread([
+ { ...email, isRead: true, unreadReminders: base.unreadNotifications },
+ ])
+ ).toBe(true);
+ expect(
+ hasUnread(
+ [{ ...email, isRead: true, unreadReminders: base.unreadNotifications }],
+ { withLocalState: () => 'done' }
+ )
+ ).toBe(false);
+ expect(
+ hasUnread([
+ {
+ ...email,
+ inboxVisible: false,
+ unreadReminders: base.unreadNotifications,
+ },
+ ])
+ ).toBe(false);
+ });
+
+ it('preserves the optional client-side email Signal classification', () => {
+ flags.clientEmailSignal = true;
+ const noise: Email = {
+ ...email,
+ labels: [
+ {
+ id: 'label',
+ name: 'CATEGORY_UPDATES',
+ providerLabelId: 'CATEGORY_UPDATES',
+ },
+ ],
+ };
+ expect(hasUnread([noise])).toBe(false);
+ expect(hasUnread([{ ...noise, isDraft: true }])).toBe(true);
+ expect(hasUnread([email])).toBe(true);
+ });
+
+ it('keeps document/chat/folder/email recency and capability gates', () => {
+ const oldMetadata = { ...base.metadata, updatedAt: '2026-08-01T00:00:00Z' };
+ const document: Item = {
+ ...base,
+ __typename: 'GraphqlSoupDocument',
+ subType: null,
+ };
+ const chat: Item = { ...base, __typename: 'GraphqlSoupChat' };
+ const folder: Item = { ...base, __typename: 'GraphqlSoupProject' };
+ for (const item of [document, chat, folder]) {
+ expect(hasUnread([item])).toBe(true);
+ expect(hasUnread([{ ...item, metadata: oldMetadata }])).toBe(false);
+ }
+ expect(hasUnread([{ ...email, sortTs: oldMetadata.updatedAt }])).toBe(
+ false
+ );
+ expect(
+ hasUnread(
+ [{ ...document, subType: { __typename: 'GraphqlSnippetSubType' } }],
+ {},
+ { ...capabilities, snippets: false }
+ )
+ ).toBe(false);
+ expect(
+ hasUnread(
+ [{ ...base, __typename: 'GraphqlSoupCalendarEvent' }],
+ {},
+ { ...capabilities, calendar: false }
+ )
+ ).toBe(false);
+ expect(
+ hasUnread(
+ [{ ...base, __typename: 'GraphqlSoupForeignEntity' }],
+ {},
+ { ...capabilities, foreignEntities: false }
+ )
+ ).toBe(false);
+ });
+
+ it('accepts server-scoped thread witnesses, not arbitrary unsupported Soup types', () => {
+ expect(
+ hasUnread([{ ...base, __typename: 'GraphqlSoupChannelMessage' }])
+ ).toBe(true);
+ expect(hasUnread([{ ...base, __typename: 'GraphqlSoupCrmCompany' }])).toBe(
+ false
+ );
+ expect(
+ hasUnread([{ ...base, __typename: 'GraphqlSoupAgentSession' }])
+ ).toBe(false);
+ });
+});
diff --git a/apps/web/src/features/home/queries/home-unread.ts b/apps/web/src/features/home/queries/home-unread.ts
new file mode 100644
index 0000000000..d93c790fad
--- /dev/null
+++ b/apps/web/src/features/home/queries/home-unread.ts
@@ -0,0 +1,75 @@
+import { ENABLE_CLIENT_EMAIL_SIGNAL_FILTER } from '@core/constant/featureFlags';
+import type { NotificationSource } from '@notifications/notification-source';
+import { notificationStateFromGraphql } from '@notifications/notification-state';
+import type { HomeUnreadPresenceQuery } from '@service-storage/graphql/generated/graphql';
+import { startOfDay, subWeeks } from 'date-fns';
+import { match } from 'ts-pattern';
+import { isSignalEmail } from '../../next-soup/filters/inbox-filters';
+import type { HomeQueryCapabilities } from './home-query';
+
+type HomeUnreadItem = HomeUnreadPresenceQuery['user']['soup']['items'][number];
+type Witness = HomeUnreadItem['unreadNotifications'][number];
+
+/** Evaluate only bounded witnesses. Full history and mark-read inputs stay separate. */
+export function hasHomeUnreadWitness(
+ items: readonly HomeUnreadItem[],
+ capabilities: HomeQueryCapabilities,
+ source: Pick<NotificationSource, 'withLocalState'>,
+ now = new Date()
+): boolean {
+ const recent = subWeeks(startOfDay(now), 2).getTime();
+ const unread = (notifications: readonly Witness[]) =>
+ notifications.some((notification) => {
+ const state = notificationStateFromGraphql(notification.state);
+ return (
+ (source.withLocalState?.({ id: notification.id, state }) ?? state) ===
+ 'unseen'
+ );
+ });
+ const isRecent = (item: HomeUnreadItem, sortTs?: string) =>
+ Date.parse(
+ sortTs ?? item.metadata.updatedAt ?? item.metadata.createdAt ?? ''
+ ) >= recent;
+
+ return items.some((item) =>
+ match(item)
+ .with(
+ { __typename: 'GraphqlSoupEmailThread' },
+ (email) =>
+ email.inboxVisible &&
+ isRecent(email, email.sortTs) &&
+ (!ENABLE_CLIENT_EMAIL_SIGNAL_FILTER ||
+ email.isDraft ||
+ isSignalEmail(email)) &&
+ (!email.isRead || unread(email.unreadReminders))
+ )
+ .with(
+ { __typename: 'GraphqlSoupDocument' },
+ (document) =>
+ (capabilities.snippets ||
+ document.subType?.__typename !== 'GraphqlSnippetSubType') &&
+ isRecent(document) &&
+ unread(document.unreadNotifications)
+ )
+ .with(
+ { __typename: 'GraphqlSoupChat' },
+ { __typename: 'GraphqlSoupProject' },
+ (entity) => isRecent(entity) && unread(entity.unreadNotifications)
+ )
+ .with(
+ { __typename: 'GraphqlSoupCalendarEvent' },
+ (event) => capabilities.calendar && unread(event.unreadNotifications)
+ )
+ .with(
+ { __typename: 'GraphqlSoupForeignEntity' },
+ (entity) =>
+ capabilities.foreignEntities && unread(entity.unreadNotifications)
+ )
+ .with(
+ { __typename: 'GraphqlSoupChannel' },
+ { __typename: 'GraphqlSoupChannelMessage' },
+ (entity) => unread(entity.unreadNotifications)
+ )
+ .otherwise(() => false)
+ );
+}
diff --git a/apps/web/src/features/home/queries/use-home-unread-query.test.ts b/apps/web/src/features/home/queries/use-home-unread-query.test.ts
new file mode 100644
index 0000000000..ad94fc1837
--- /dev/null
+++ b/apps/web/src/features/home/queries/use-home-unread-query.test.ts
@@ -0,0 +1,248 @@
+import { disposeChannelNotificationRefresh } from '@queries/channel/notification-refresh';
+import { revalidateNotificationReaders } from '@queries/notification/revalidation';
+import { getActiveGraphqlSoupRevalidations } from '@queries/soup/graphql/active-queries';
+import { HomeUnreadPresenceDocument } from '@service-storage/graphql/generated/graphql';
+import {
+ CombinedError,
+ createClient,
+ type Operation,
+ type OperationResult,
+} from '@urql/core';
+import { Kind, print, visit } from 'graphql';
+import { createRoot, createSignal } from 'solid-js';
+import { afterEach, describe, expect, it, vi } from 'vitest';
+import { makeSubject, pipe, subscribe } from 'wonka';
+import { useHomeUnreadQuery } from './use-home-unread-query';
+
+const mocks = vi.hoisted(() => ({
+ client: vi.fn(),
+ legacy: vi.fn(),
+ legacyUnread: vi.fn(),
+ notifiedSort: vi.fn(),
+}));
+vi.mock('@app/lib/analytics/posthog', () => ({
+ useFeatureFlag: () => () => ({ enabled: mocks.notifiedSort() }),
+}));
+vi.mock('@service-storage/graphql-soup', () => ({
+ getGraphqlSoupClient: mocks.client,
+}));
+vi.mock('./use-home-query', () => ({ useHomeEntitiesQuery: mocks.legacy }));
+vi.mock('@service-storage/websocket', () => ({
+ storageWS: { reconnectIfDisconnected: vi.fn() },
+ createWebSocketJob: vi.fn(),
+}));
+vi.mock('@service-connection/websocket', () => ({
+ ws: { addEventListener: vi.fn(), send: vi.fn() },
+ state: () => 'closed',
+ createConnectionBlockWebsocketEffect: vi.fn(),
+ createConnectionWebsocketEffect: vi.fn(),
+}));
+
+const cleanups: (() => void)[] = [];
+afterEach(() => {
+ cleanups.splice(0).forEach((fn) => fn());
+ vi.clearAllMocks();
+ vi.restoreAllMocks();
+});
+
+function setup(initialNotifiedSort = false) {
+ const operations: Operation[] = [];
+ const network = makeSubject<OperationResult>();
+ const client = createClient({
+ url: 'http://test/graphql',
+ exchanges: [
+ () => (ops) => {
+ pipe(
+ ops,
+ subscribe((op) => operations.push(op))
+ );
+ return network.source;
+ },
+ ],
+ });
+ mocks.client.mockReturnValue(client);
+ const root = createRoot((dispose) => {
+ cleanups.push(dispose, () => disposeChannelNotificationRefresh(client));
+ const [enabled, setEnabled] = createSignal(false);
+ const [notifiedSort, setNotifiedSort] = createSignal(initialNotifiedSort);
+ mocks.notifiedSort.mockImplementation(notifiedSort);
+ const [state, setState] = createSignal<'unseen' | 'seen' | 'done'>();
+ mocks.legacyUnread.mockReturnValue(true);
+ mocks.legacy.mockReturnValue({
+ query: {
+ isLoading: false,
+ get data() {
+ if (enabled() && !notifiedSort())
+ throw new Error('Read inactive full Soup query');
+ return { entities: [] };
+ },
+ },
+ hasUnreadEntity: mocks.legacyUnread,
+ notificationSource: {
+ withLocalState: (notification: { state: string }) =>
+ state() ?? notification.state,
+ },
+ viewContext: () => ({
+ tab: 'signal',
+ facets: { read: ['unread'] },
+ facetContext: {},
+ userId: 'viewer',
+ capabilities: {
+ calendar: true,
+ snippets: true,
+ foreignEntities: true,
+ notifiedSort: notifiedSort(),
+ },
+ }),
+ });
+ const unread = useHomeUnreadQuery(enabled);
+ return { unread, setEnabled, setState, setNotifiedSort };
+ });
+ const queries = () => operations.filter((op) => op.kind === 'query');
+ const respond = (state: 'UNSEEN' | 'SEEN', error?: CombinedError) =>
+ network.next({
+ operation: queries().at(-1)!,
+ stale: false,
+ hasNext: false,
+ error,
+ ...(!error
+ ? {
+ data: {
+ user: {
+ id: 'viewer',
+ soup: {
+ items: [
+ {
+ __typename: 'GraphqlSoupChannel',
+ id: 'channel',
+ metadata: {
+ createdAt: new Date().toISOString(),
+ updatedAt: new Date().toISOString(),
+ },
+ unreadNotifications: [{ id: 'witness', state }],
+ },
+ ],
+ },
+ },
+ },
+ }
+ : {}),
+ });
+ return { ...root, client, queries, respond };
+}
+
+describe('Home unread presence query', () => {
+ it('selects bounded witnesses rather than historical notification content', () => {
+ const fields: string[] = [];
+ const edges: string[] = [];
+ visit(HomeUnreadPresenceDocument, {
+ Field(node) {
+ fields.push(node.name.value);
+ if (node.name.value !== 'notifications') return;
+ edges.push(print(node));
+ expect(
+ node.arguments?.find((arg) => arg.name.value === 'limit')?.value
+ ).toMatchObject({ kind: Kind.INT, value: '1' });
+ expect(
+ node.selectionSet?.selections.map((selection) =>
+ selection.kind === Kind.FIELD ? selection.name.value : ''
+ )
+ ).toEqual(['id', 'state']);
+ },
+ });
+ expect(edges).toHaveLength(2);
+ expect(edges[0]).toContain('channelFeedOnly: true');
+ expect(edges[1]).toContain('eventTypes: ["reminder"]');
+ expect(fields).not.toContain('nextCursor');
+ expect(fields).not.toContain('content');
+ expect(fields).not.toContain('properties');
+ expect(print(HomeUnreadPresenceDocument)).not.toContain('SoupItemFields');
+ });
+
+ it('switches rollout paths without enabling or reading full GraphQL Soup', async () => {
+ const f = setup();
+ expect(f.unread()).toBe(true);
+ expect(f.queries()).toHaveLength(0);
+ expect(mocks.legacy.mock.calls[0][1].enabled()).toBe(true);
+ f.setEnabled(true);
+ expect(mocks.legacy.mock.calls[0][1].enabled()).toBe(false);
+ expect(f.unread()).toBe(false);
+ await vi.waitFor(() => expect(f.queries()).toHaveLength(1));
+ const op = f.queries()[0];
+ expect(op.query).toEqual(HomeUnreadPresenceDocument);
+ expect(op.variables?.input.initial).toMatchObject({
+ limit: 100,
+ expand: true,
+ emailView: 'INBOX',
+ });
+ expect(JSON.stringify(op.variables)).toContain('UNSEEN');
+ f.respond('UNSEEN');
+ expect(f.unread()).toBe(true);
+ f.setState('seen');
+ expect(f.unread()).toBe(false);
+ f.setState(undefined);
+ expect(f.unread()).toBe(true);
+ f.respond('SEEN');
+ expect(f.unread()).toBe(false);
+ f.setEnabled(false);
+ expect(f.unread()).toBe(true);
+ expect(getActiveGraphqlSoupRevalidations(f.client)).toEqual([]);
+ });
+
+ it('keeps notified-at sorting on REST, including while GraphQL is disabled', async () => {
+ const f = setup(true);
+ expect(f.unread()).toBe(true);
+ expect(f.queries()).toHaveLength(0);
+ f.setEnabled(true);
+ expect(f.unread()).toBe(true);
+ expect(mocks.legacy.mock.calls[0][1].enabled()).toBe(true);
+ expect(f.queries()).toHaveLength(0);
+ expect(getActiveGraphqlSoupRevalidations(f.client)).toEqual([]);
+ f.setNotifiedSort(false);
+ expect(mocks.legacy.mock.calls[0][1].enabled()).toBe(false);
+ await vi.waitFor(() => expect(f.queries()).toHaveLength(1));
+ f.respond('UNSEEN');
+ expect(f.unread()).toBe(true);
+ f.setNotifiedSort(true);
+ expect(f.unread()).toBe(true);
+ expect(getActiveGraphqlSoupRevalidations(f.client)).toEqual([]);
+ });
+
+ it('refreshes the bounded edge after notification mutations and unregisters it on disposal', async () => {
+ vi.spyOn(document, 'hidden', 'get').mockReturnValue(false);
+ const f = setup();
+ f.setEnabled(true);
+ await vi.waitFor(() => expect(f.queries()).toHaveLength(1));
+ f.respond('UNSEEN');
+ expect(getActiveGraphqlSoupRevalidations(f.client)).toEqual([
+ {
+ document: HomeUnreadPresenceDocument,
+ variables: f.queries()[0].variables,
+ },
+ ]);
+ const query = vi.spyOn(f.client, 'query');
+ await revalidateNotificationReaders(f.client);
+ await vi.waitFor(() => expect(query).toHaveBeenCalledOnce());
+ expect(query).toHaveBeenCalledWith(
+ HomeUnreadPresenceDocument,
+ f.queries()[0].variables,
+ { requestPolicy: 'network-only' }
+ );
+ f.respond('SEEN');
+ expect(f.unread()).toBe(false);
+ cleanups.splice(0).forEach((fn) => fn());
+ expect(getActiveGraphqlSoupRevalidations(f.client)).toEqual([]);
+ });
+
+ it('retains cached evidence if a background refresh fails', async () => {
+ const f = setup();
+ f.setEnabled(true);
+ await vi.waitFor(() => expect(f.queries()).toHaveLength(1));
+ f.respond('UNSEEN');
+ f.respond(
+ 'UNSEEN',
+ new CombinedError({ networkError: new Error('offline') })
+ );
+ expect(f.unread()).toBe(true);
+ });
+});
diff --git a/apps/web/src/features/home/queries/use-home-unread-query.ts b/apps/web/src/features/home/queries/use-home-unread-query.ts
new file mode 100644
index 0000000000..187080782d
--- /dev/null
+++ b/apps/web/src/features/home/queries/use-home-unread-query.ts
@@ -0,0 +1,92 @@
+import { useFeatureFlag } from '@app/lib/analytics/posthog';
+import { enableInboxNotifiedSort } from '@core/constant/featureFlags';
+import { createLiveQuery } from '@graphql-cache/solid/create-live-query';
+import { registerActivityRevalidator } from '@queries/activity/push-registry';
+import { registerChannelNotificationRefresh } from '@queries/channel/register-notification-refresh';
+import {
+ registerActiveGraphqlSoupQuery,
+ registerGraphqlSoupRevalidations,
+} from '@queries/soup/graphql/active-queries';
+import { makeGraphqlSoupInput } from '@queries/soup/graphql/ast';
+import {
+ HomeUnreadPresenceDocument,
+ type HomeUnreadPresenceQuery,
+} from '@service-storage/graphql/generated/graphql';
+import { getGraphqlSoupClient } from '@service-storage/graphql-soup';
+import { type Accessor, createMemo, onCleanup } from 'solid-js';
+import { buildHomeQuery } from './home-query';
+import { hasHomeUnreadWitness } from './home-unread';
+import { useHomeEntitiesQuery } from './use-home-query';
+
+const selectItems = (data: HomeUnreadPresenceQuery) => data.user.soup.items;
+
+/** Home's existing membership, with bounded state-only edges rather than history. */
+export function useHomeUnreadQuery(
+ graphqlEnabled: Accessor<boolean>
+): Accessor<boolean> {
+ // Notified-at sorting is REST-only. Keep that rollout's existing candidate
+ // page rather than silently changing its order/bounds or building an invalid
+ // GraphQL input. Disabled queries must not compile an unsupported AST either.
+ const notifiedSort = useFeatureFlag(enableInboxNotifiedSort);
+ const enabled = () => graphqlEnabled() && !notifiedSort().enabled;
+ const legacy = useHomeEntitiesQuery(
+ { tab: 'signal', facets: { read: ['unread'] } },
+ { enabled: () => !enabled() }
+ );
+ const variables = createMemo(() =>
+ enabled()
+ ? { input: makeGraphqlSoupInput(buildHomeQuery(legacy.viewContext())) }
+ : undefined
+ );
+ const query = createLiveQuery(HomeUnreadPresenceDocument, variables, () => ({
+ client: getGraphqlSoupClient(),
+ enabled: enabled(),
+ requestPolicy: 'cache-and-network',
+ select: selectItems,
+ }));
+ const items = () => (!query.isPending ? (query.data ?? []) : []);
+ const queries = () => {
+ const value = variables();
+ return value
+ ? [{ document: HomeUnreadPresenceDocument, variables: value }]
+ : [];
+ };
+ const refresh = registerChannelNotificationRefresh(() => ({
+ client: getGraphqlSoupClient(),
+ queries: queries(),
+ reader: {
+ enabled: enabled(),
+ fetching: query.isFetching,
+ filtered: true,
+ scope: 'all-entities',
+ notificationIds: items().flatMap((item) => [
+ ...item.unreadNotifications.map((notification) => notification.id),
+ ...(item.__typename === 'GraphqlSoupEmailThread'
+ ? item.unreadReminders.map((notification) => notification.id)
+ : []),
+ ]),
+ },
+ }));
+ onCleanup(registerGraphqlSoupRevalidations(queries, getGraphqlSoupClient));
+ onCleanup(registerActiveGraphqlSoupQuery({ isEnabled: enabled, refresh }));
+ onCleanup(
+ registerActivityRevalidator({
+ client: getGraphqlSoupClient,
+ refresh: async () => {
+ if (enabled()) await refresh();
+ },
+ })
+ );
+
+ return () => {
+ if (!enabled()) {
+ if (legacy.query.isLoading) return false;
+ return legacy.hasUnreadEntity(legacy.query.data?.entities ?? []);
+ }
+ return hasHomeUnreadWitness(
+ items(),
+ legacy.viewContext().capabilities,
+ legacy.notificationSource
+ );
+ };
+}
diff --git a/apps/web/src/features/next-soup/filters/inbox-filters.ts b/apps/web/src/features/next-soup/filters/inbox-filters.ts
index fa4a18b25c..35eb2cd901 100644
--- a/apps/web/src/features/next-soup/filters/inbox-filters.ts
+++ b/apps/web/src/features/next-soup/filters/inbox-filters.ts
@@ -42,9 +42,15 @@ const DEPRIORITY_LABELS = [
},
];
-const getLabelTokens = (
- labels?: Array<{ id?: string; providerLabelId?: string; name?: string }>
-): string[] => {
+type SignalEmail = {
+ labels?: readonly {
+ id?: string;
+ providerLabelId?: string | null;
+ name?: string | null;
+ }[];
+};
+
+const getLabelTokens = (labels?: SignalEmail['labels']): string[] => {
if (!labels?.length) return [];
const tokens: string[] = [];
@@ -59,7 +65,7 @@ const getLabelTokens = (
type EmailEntity = Extract<EntityData, { type: 'email' }>;
-function getEmailSignalInfo(entity: EmailEntity): {
+function getEmailSignalInfo(entity: SignalEmail): {
hasPriority: boolean;
hasDepriority: boolean;
} {
@@ -81,7 +87,7 @@ function getEmailSignalInfo(entity: EmailEntity): {
}
/** Check if email is signal (important) */
-function isSignalEmail(entity: EmailEntity): boolean {
+export function isSignalEmail(entity: SignalEmail): boolean {
const { hasPriority, hasDepriority } = getEmailSignalInfo(entity);
// Signal = has priority indicators OR no depriority indicators
return hasPriority || !hasDepriority;
diff --git a/apps/web/src/lib/queries/channel/notification-refresh.test.ts b/apps/web/src/lib/queries/channel/notification-refresh.test.ts
index f4fc5d2ce4..1dbfe779f2 100644
--- a/apps/web/src/lib/queries/channel/notification-refresh.test.ts
+++ b/apps/web/src/lib/queries/channel/notification-refresh.test.ts
@@ -30,7 +30,9 @@ function setup() {
const request = vi
.fn<() => Promise<{ error?: CombinedError }>>()
.mockResolvedValue({});
- const query = vi.fn(() => ({ toPromise: request }));
+ const query = vi.fn((..._args: Parameters<Client['query']>) => ({
+ toPromise: request,
+ }));
const client = { query } as unknown as Client;
const queue = channelNotificationRefresh(client);
cleanups.push(() => disposeChannelNotificationRefresh(client));
@@ -160,6 +162,41 @@ describe('shared channel notification refresh', () => {
expect(f.query).toHaveBeenCalledTimes(3);
});
+ it('refreshes heterogeneous witnesses for non-channel changes without waking channel readers', async () => {
+ const f = setup();
+ f.register('channel');
+ const home = f.register('home', {
+ channelId: undefined,
+ scope: 'all-entities',
+ filtered: true,
+ notificationIds: ['notification'],
+ });
+ const notification: GraphqlNotificationPatch = {
+ ...patch('document', true),
+ notification: {
+ id: 'notification',
+ entityType: 'DOCUMENT',
+ entityId: 'document',
+ },
+ } as GraphqlNotificationPatch;
+ f.queue.onPatch(notification, true);
+ await tick();
+ expect(f.query).toHaveBeenCalledExactlyOnceWith(
+ document,
+ { id: 'home' },
+ { requestPolicy: 'network-only' }
+ );
+ // Replacing the single witness may reveal an older unread notification.
+ home.reader.notificationIds = [];
+ f.queue.onPatch(notification, true);
+ await tick();
+ expect(f.query).toHaveBeenCalledTimes(2);
+ home.reader.enabled = false;
+ f.queue.onPatch(notification, true);
+ await tick();
+ expect(f.query).toHaveBeenCalledTimes(2);
+ });
+
it('refreshes a full edge when an updated notification is not in its membership', async () => {
const f = setup();
f.register();
@@ -186,6 +223,24 @@ describe('shared channel notification refresh', () => {
expect(f.query).toHaveBeenCalledTimes(4);
});
+ it('refreshes Home when another reader owns deleted thread-scoping evidence', async () => {
+ const f = setup();
+ f.register('thread', { notificationIds: ['seen-reply'] });
+ f.register('other-channel');
+ f.register('home', {
+ scope: 'all-entities',
+ channelId: undefined,
+ filtered: true,
+ });
+ f.queue.onPatch(deletion('seen-reply'), true);
+ await tick();
+ expect(f.query).toHaveBeenCalledTimes(2);
+ expect(f.query.mock.calls.map((call) => call[1])).toEqual([
+ { id: 'thread' },
+ { id: 'home' },
+ ]);
+ });
+
it('reconnects enabled readers without starting disabled or global feeds', async () => {
const f = setup();
f.register();
diff --git a/apps/web/src/lib/queries/channel/notification-refresh.ts b/apps/web/src/lib/queries/channel/notification-refresh.ts
index 208717bf74..3237063d24 100644
--- a/apps/web/src/lib/queries/channel/notification-refresh.ts
+++ b/apps/web/src/lib/queries/channel/notification-refresh.ts
@@ -7,6 +7,8 @@ type QueryClient = Pick<Client, 'query'>;
export type ChannelNotificationReader = {
enabled: boolean;
fetching: boolean;
+ /** A heterogeneous unread indicator also needs non-channel edge membership. */
+ scope?: 'all-entities';
/** Omitted for channel lists, which can gain previously absent channels. */
channelId?: string;
filtered: boolean;
@@ -181,22 +183,45 @@ export class ChannelNotificationRefresh {
reader.notificationIds.includes(patch.entityId)
)
);
- // A deletion contains no parent channel. Unknown IDs require recovery
- // across enabled readers; known IDs affect only their cached owners.
- for (const job of owners.length ? owners : this.jobs.values()) {
+ // A deletion contains no parent channel. Heterogeneous witnesses may
+ // depend on a deleted *seen* thread reason they never selected, so they
+ // must recover even when another reader owns the deleted notification.
+ const affected = owners.length
+ ? new Set([
+ ...owners,
+ ...[...this.jobs.values()].filter((job) =>
+ [...job.readers].some(
+ (reader) => reader.scope === 'all-entities'
+ )
+ ),
+ ])
+ : this.jobs.values();
+ for (const job of affected) {
if (this.enabled(job)) this.invalidate(job);
}
} else if (patch.graphqlTypeName === 'GraphqlSoupChannel') {
this.invalidateChannel(patch.entityId);
} else return;
} else {
- if (patch.notification.entityType !== 'CHANNEL') return;
- this.invalidateChannel(
- patch.notification.entityId,
- normalized && patch.__typename === 'GraphqlUpdatedNotification'
- ? patch.notification.id
- : undefined
- );
+ if (patch.notification.entityType === 'CHANNEL') {
+ this.invalidateChannel(
+ patch.notification.entityId,
+ normalized && patch.__typename === 'GraphqlUpdatedNotification'
+ ? patch.notification.id
+ : undefined
+ );
+ } else {
+ // A changed normalized state can remove the only bounded witness; a
+ // new notification can add an entity absent from the current page.
+ for (const job of this.jobs.values()) {
+ if (
+ [...job.readers].some(
+ (reader) => reader.enabled && reader.scope === 'all-entities'
+ )
+ )
+ this.invalidate(job);
+ }
+ }
}
this.schedule();
}
diff --git a/apps/web/src/lib/queries/notification/revalidation.ts b/apps/web/src/lib/queries/notification/revalidation.ts
index e70cac81fb..0ee8b1751e 100644
--- a/apps/web/src/lib/queries/notification/revalidation.ts
+++ b/apps/web/src/lib/queries/notification/revalidation.ts
@@ -4,6 +4,7 @@ import {
ChannelListSoupDocument,
ChannelUnreadPresenceDocument,
GroupSoupDocument,
+ HomeUnreadPresenceDocument,
SoupDocument,
SoupNotificationsDocument,
} from '@service-storage/graphql/generated/graphql';
@@ -23,6 +24,7 @@ const notificationDocuments = new Set<QueryRevalidation['document']>([
ChannelListSoupDocument,
ChannelUnreadPresenceDocument,
GroupSoupDocument,
+ HomeUnreadPresenceDocument,
SoupDocument,
SoupNotificationsDocument,
]);
diff --git a/apps/web/src/lib/queries/soup/graphql/channel-list-revalidation.ts b/apps/web/src/lib/queries/soup/graphql/channel-list-revalidation.ts
index 32f1c7cbb7..302bf090f1 100644
--- a/apps/web/src/lib/queries/soup/graphql/channel-list-revalidation.ts
+++ b/apps/web/src/lib/queries/soup/graphql/channel-list-revalidation.ts
@@ -1,6 +1,7 @@
import {
ChannelListSoupDocument,
ChannelUnreadPresenceDocument,
+ HomeUnreadPresenceDocument,
} from '@service-storage/graphql/generated/graphql';
import type { Client } from '@urql/core';
import { delegateChannelNotificationRefresh } from '../../channel/notification-refresh';
@@ -11,7 +12,8 @@ export function getChannelListRevalidations(client?: Pick<Client, 'query'>) {
return getActiveGraphqlSoupRevalidations(client).filter(
(query) =>
query.document === ChannelListSoupDocument ||
- query.document === ChannelUnreadPresenceDocument
+ query.document === ChannelUnreadPresenceDocument ||
+ query.document === HomeUnreadPresenceDocument
);
}
diff --git a/apps/web/src/lib/service-clients/service-storage/graphql/generated/graphql.ts b/apps/web/src/lib/service-clients/service-storage/graphql/generated/graphql.ts
index fc654dd780..6220c4fbc0 100644
--- a/apps/web/src/lib/service-clients/service-storage/graphql/generated/graphql.ts
+++ b/apps/web/src/lib/service-clients/service-storage/graphql/generated/graphql.ts
@@ -10352,6 +10352,33 @@ export type GraphqlProjectQuickAccessNameFragment = { __typename: 'GraphqlSoupPr
export type GraphqlChannelQuickAccessFieldsFragment = { __typename: 'GraphqlSoupChannel', name: string | null, channelType: string, ownerId: string, createdAt: string, updatedAt: string, viewedAt: string | null, interactedAt: string | null, participants: Array<{ userId: string }> };
+export type HomeUnreadPresenceQueryVariables = Exact<{
+ input: SoupInput;
+}>;
+
+
+export type HomeUnreadPresenceQuery = { user: { id: string, soup: { items: Array<
+ | { __typename: 'GraphqlSoupAgentSession', id: string, metadata: { createdAt: string | null, updatedAt: string | null }, unreadNotifications: Array<{ id: string, state: NotificationState }> }
+ | { __typename: 'GraphqlSoupCalendarEvent', id: string, metadata: { createdAt: string | null, updatedAt: string | null }, unreadNotifications: Array<{ id: string, state: NotificationState }> }
+ | { __typename: 'GraphqlSoupCall', id: string, metadata: { createdAt: string | null, updatedAt: string | null }, unreadNotifications: Array<{ id: string, state: NotificationState }> }
+ | { __typename: 'GraphqlSoupChannel', id: string, metadata: { createdAt: string | null, updatedAt: string | null }, unreadNotifications: Array<{ id: string, state: NotificationState }> }
+ | { __typename: 'GraphqlSoupChannelMessage', id: string, metadata: { createdAt: string | null, updatedAt: string | null }, unreadNotifications: Array<{ id: string, state: NotificationState }> }
+ | { __typename: 'GraphqlSoupChat', id: string, metadata: { createdAt: string | null, updatedAt: string | null }, unreadNotifications: Array<{ id: string, state: NotificationState }> }
+ | { __typename: 'GraphqlSoupCrmCompany', id: string, metadata: { createdAt: string | null, updatedAt: string | null }, unreadNotifications: Array<{ id: string, state: NotificationState }> }
+ | { __typename: 'GraphqlSoupCrmContact', id: string, metadata: { createdAt: string | null, updatedAt: string | null }, unreadNotifications: Array<{ id: string, state: NotificationState }> }
+ | { __typename: 'GraphqlSoupDatabaseRow', id: string, metadata: { createdAt: string | null, updatedAt: string | null }, unreadNotifications: Array<{ id: string, state: NotificationState }> }
+ | { __typename: 'GraphqlSoupDocument', id: string, subType:
+ | { __typename: 'GraphqlInitiativeDescriptionSubType' }
+ | { __typename: 'GraphqlSkillSubType' }
+ | { __typename: 'GraphqlSnippetSubType' }
+ | { __typename: 'GraphqlTaskSubType' }
+ | null, metadata: { createdAt: string | null, updatedAt: string | null }, unreadNotifications: Array<{ id: string, state: NotificationState }> }
+ | { __typename: 'GraphqlSoupEmailThread', isRead: boolean, inboxVisible: boolean, isDraft: boolean, sortTs: string, id: string, labels: Array<{ id: string, name: string, providerLabelId: string }>, unreadReminders: Array<{ id: string, state: NotificationState }>, metadata: { createdAt: string | null, updatedAt: string | null }, unreadNotifications: Array<{ id: string, state: NotificationState }> }
+ | { __typename: 'GraphqlSoupForeignEntity', id: string, metadata: { createdAt: string | null, updatedAt: string | null }, unreadNotifications: Array<{ id: string, state: NotificationState }> }
+ | { __typename: 'GraphqlSoupInitiative', id: string, metadata: { createdAt: string | null, updatedAt: string | null }, unreadNotifications: Array<{ id: string, state: NotificationState }> }
+ | { __typename: 'GraphqlSoupProject', id: string, metadata: { createdAt: string | null, updatedAt: string | null }, unreadNotifications: Array<{ id: string, state: NotificationState }> }
+ > } } };
+
export type InitiativeDetailFieldsFragment = { __typename: 'GraphqlSoupInitiative', id: string, displayName: string | null, taskCount: number, completedTaskCount: number, memberIds: Array<string>, taskIds: Array<string>, metadata: { ownerId: string | null, createdAt: string | null, updatedAt: string | null }, viewerPermission:
| { __typename: 'GraphqlAccessLevelPermission', accessLevel: GraphqlEntityAccessLevel }
| { __typename: 'GraphqlChannelRolePermission' }
@@ -17635,6 +17662,7 @@ export const RenameFormDocument = {"kind":"Document","definitions":[{"kind":"Ope
export const TrashFormDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"TrashForm"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"trashEntities"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"entities"},"value":{"kind":"ListValue","values":[{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"type"},"value":{"kind":"EnumValue","value":"FORM"}},{"kind":"ObjectField","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}]}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"results"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"FormEntityMutationResultFields"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"FormEntityMutationResultFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlEntityMutationResult"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlMutationError"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"errorCode"}},{"kind":"Field","name":{"kind":"Name","value":"message"}}]}}]}}]} as unknown as DocumentNode<TrashFormMutation, TrashFormMutationVariables>;
export const GroupSoupMembershipDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GroupSoupMembership"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"GroupedSoupInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"user"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"groupSoup"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"bins"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"key"}},{"kind":"Field","name":{"kind":"Name","value":"totalCount"}},{"kind":"Field","name":{"kind":"Name","value":"nextCursor"}},{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"Field","name":{"kind":"Name","value":"id"}}]}}]}}]}}]}}]}}]} as unknown as DocumentNode<GroupSoupMembershipQuery, GroupSoupMembershipQueryVariables>;
export const GroupSoupDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GroupSoup"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"GroupedSoupInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"user"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"groupSoup"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"bins"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"key"}},{"kind":"Field","name":{"kind":"Name","value":"totalCount"}},{"kind":"Field","name":{"kind":"Name","value":"nextCursor"}},{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupItemFields"}}]}}]}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupEntityIdentityFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupEntity"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"entityType"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"isFavorited"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupPropertyValueFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlBooleanPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"boolValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlNumberPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"numberValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlStringPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"stringValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlDatePropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"dateValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSelectOptionPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"optionIds"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlEntityReferencePropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"references"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"entityId"}},{"kind":"Field","name":{"kind":"Name","value":"entityType"}},{"kind":"Field","name":{"kind":"Name","value":"specificMessageId"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlLinkPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"urls"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupPropertyFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlProperty"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"propertyDefinitionId"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"dataType"}},{"kind":"Field","name":{"kind":"Name","value":"isMultiSelect"}},{"kind":"Field","name":{"kind":"Name","value":"specificEntityType"}},{"kind":"Field","name":{"kind":"Name","value":"isSystem"}},{"kind":"Field","name":{"kind":"Name","value":"isMetadata"}},{"kind":"Field","name":{"kind":"Name","value":"value"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyValueFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"MailPreviewFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlMailPreviewMessage"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"subject"}},{"kind":"Field","name":{"kind":"Name","value":"snippet"}},{"kind":"Field","name":{"kind":"Name","value":"isDraft"}},{"kind":"Field","name":{"kind":"Name","value":"senderEmail"}},{"kind":"Field","name":{"kind":"Name","value":"senderName"}},{"kind":"Field","name":{"kind":"Name","value":"senderPhotoUrl"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"EmailDraftAggregateFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlMailDraftAggregate"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"messageCount"}},{"kind":"Field","name":{"kind":"Name","value":"inboxVisible"}},{"kind":"Field","name":{"kind":"Name","value":"isRead"}},{"kind":"Field","name":{"kind":"Name","value":"isSignal"}},{"kind":"Field","name":{"kind":"Name","value":"hasCalendarAttachment"}},{"kind":"Field","name":{"kind":"Name","value":"latestInboundMessageTs"}},{"kind":"Field","name":{"kind":"Name","value":"latestNonSpamMessageTs"}},{"kind":"Field","name":{"kind":"Name","value":"latestOutboundMessageTs"}},{"kind":"Field","name":{"kind":"Name","value":"previewTs"}},{"kind":"Field","name":{"kind":"Name","value":"preview"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"MailPreviewFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"EmailDraftStateFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlMailDraftState"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"baseline"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"EmailDraftAggregateFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"drafts"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"macroDraft"}},{"kind":"Field","name":{"kind":"Name","value":"facts"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"EmailDraftAggregateFields"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupChannelMessageFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupChannelMessagePreview"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"messageId"}},{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"threadId"}},{"kind":"Field","name":{"kind":"Name","value":"senderId"}},{"kind":"Field","name":{"kind":"Name","value":"content"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"mentions"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"GraphqlCrmContactFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupCrmContact"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","alias":{"kind":"Name","value":"contactTeamId"},"name":{"kind":"Name","value":"teamId"}},{"kind":"Field","name":{"kind":"Name","value":"companyId"}},{"kind":"Field","name":{"kind":"Name","value":"companyName"}},{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","alias":{"kind":"Name","value":"crmContactName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"hidden"}},{"kind":"Field","name":{"kind":"Name","value":"firstInteraction"}},{"kind":"Field","name":{"kind":"Name","value":"lastInteraction"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupItemPreviewFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupEntity"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"Field","name":{"kind":"Name","value":"cacheProjection"},"directives":[{"kind":"Directive","name":{"kind":"Name","value":"cacheOnly"}}]},{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupEntityIdentityFields"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupAgentSession"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"sessionName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"isArchived"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"botId"}},{"kind":"Field","name":{"kind":"Name","value":"harness"}},{"kind":"Field","name":{"kind":"Name","value":"repoUrl"}},{"kind":"Field","name":{"kind":"Name","value":"repoBranch"}},{"kind":"Field","name":{"kind":"Name","value":"pullRequestUrl"}},{"kind":"Field","name":{"kind":"Name","value":"workingBranch"}},{"kind":"Field","name":{"kind":"Name","value":"pullRequestState"}},{"kind":"Field","name":{"kind":"Name","value":"pullRequestId"}},{"kind":"Field","name":{"kind":"Name","value":"turnState"}},{"kind":"Field","name":{"kind":"Name","value":"bot"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}}]}},{"kind":"Field","name":{"kind":"Name","value":"threadId"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"frecencyScore"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupDatabaseRow"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"tableId"}},{"kind":"Field","name":{"kind":"Name","value":"databaseId"}},{"kind":"Field","name":{"kind":"Name","value":"position"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"creatorId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupInitiative"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"metadata"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"viewerPermission"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlAccessLevelPermission"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"accessLevel"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupDocument"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"documentName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"fileType"}},{"kind":"Field","name":{"kind":"Name","value":"projectId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"subType"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlTaskSubType"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"isCompleted"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupChat"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"chatName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"model"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"projectId"}},{"kind":"Field","name":{"kind":"Name","value":"isPersistent"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupProject"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"projectName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"parentId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupEmailThread"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"providerId"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"inboxVisible"}},{"kind":"Field","name":{"kind":"Name","value":"linkId"}},{"kind":"Field","name":{"kind":"Name","value":"latestInboundMessageTs"}},{"kind":"Field","name":{"kind":"Name","value":"reminderReturnedAt"}},{"kind":"Field","name":{"kind":"Name","value":"mailDraftState"},"directives":[{"kind":"Directive","name":{"kind":"Name","value":"cacheOnly"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"EmailDraftStateFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"mailAllPreview"},"directives":[{"kind":"Directive","name":{"kind":"Name","value":"cacheOnly"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"MailPreviewFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"mailDraftPreview"},"directives":[{"kind":"Directive","name":{"kind":"Name","value":"cacheOnly"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"MailPreviewFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"mailSentPreview"},"directives":[{"kind":"Directive","name":{"kind":"Name","value":"cacheOnly"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"MailPreviewFields"}}]}},{"kind":"Field","alias":{"kind":"Name","value":"emailName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"snippet"}},{"kind":"Field","name":{"kind":"Name","value":"senderEmail"}},{"kind":"Field","name":{"kind":"Name","value":"senderName"}},{"kind":"Field","name":{"kind":"Name","value":"senderPhotoUrl"}},{"kind":"Field","name":{"kind":"Name","value":"isRead"}},{"kind":"Field","name":{"kind":"Name","value":"isDraft"}},{"kind":"Field","name":{"kind":"Name","value":"isImportant"}},{"kind":"Field","name":{"kind":"Name","value":"isSignal"}},{"kind":"Field","name":{"kind":"Name","value":"projectId"}},{"kind":"Field","name":{"kind":"Name","value":"sortTs"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"participants"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"linkId"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","name":{"kind":"Name","value":"sfsPhotoUrl"}}]}},{"kind":"Field","name":{"kind":"Name","value":"attachments"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"messageId"}},{"kind":"Field","name":{"kind":"Name","value":"providerAttachmentId"}},{"kind":"Field","name":{"kind":"Name","value":"filename"}},{"kind":"Field","name":{"kind":"Name","value":"mimeType"}},{"kind":"Field","name":{"kind":"Name","value":"sizeBytes"}},{"kind":"Field","name":{"kind":"Name","value":"contentId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"labels"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"linkId"}},{"kind":"Field","name":{"kind":"Name","value":"providerLabelId"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"messageListVisibility"}},{"kind":"Field","name":{"kind":"Name","value":"labelListVisibility"}},{"kind":"Field","name":{"kind":"Name","value":"type"}}]}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupChannel"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"channelName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"channelType"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"organizationId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelTeamId"},"name":{"kind":"Name","value":"teamId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"interactedAt"}},{"kind":"Field","name":{"kind":"Name","value":"isParticipant"}},{"kind":"Field","name":{"kind":"Name","value":"participants"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"userId"}},{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"Field","name":{"kind":"Name","value":"joinedAt"}},{"kind":"Field","name":{"kind":"Name","value":"leftAt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"latestMessage"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupChannelMessageFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"latestNonThreadMessage"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupChannelMessageFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupChannelMessage"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"senderId"}},{"kind":"Field","name":{"kind":"Name","value":"content"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"effectiveUpdatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"replyCount"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupCall"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"callChannelId"},"name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"channelName"}},{"kind":"Field","name":{"kind":"Name","value":"createdBy"}},{"kind":"Field","name":{"kind":"Name","value":"customName"}},{"kind":"Field","name":{"kind":"Name","value":"summary"}},{"kind":"Field","name":{"kind":"Name","value":"startedAt"}},{"kind":"Field","name":{"kind":"Name","value":"endedAt"}},{"kind":"Field","name":{"kind":"Name","value":"durationMs"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"attended"}},{"kind":"Field","name":{"kind":"Name","value":"participants"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"userId"}},{"kind":"Field","name":{"kind":"Name","value":"joinedAt"}},{"kind":"Field","name":{"kind":"Name","value":"leftAt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"guests"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"joinedAt"}},{"kind":"Field","name":{"kind":"Name","value":"leftAt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"GraphqlCrmContactFields"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupCrmCompany"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"crmTeamId"},"name":{"kind":"Name","value":"teamId"}},{"kind":"Field","alias":{"kind":"Name","value":"crmCompanyName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"emailSync"}},{"kind":"Field","name":{"kind":"Name","value":"hidden"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"domains"}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupForeignEntity"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"foreignEntityId"}},{"kind":"Field","name":{"kind":"Name","value":"foreignEntitySource"}},{"kind":"Field","name":{"kind":"Name","value":"storedForId"}},{"kind":"Field","name":{"kind":"Name","value":"storedForAuthEntity"}},{"kind":"Field","name":{"kind":"Name","value":"sourceMetadata"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupCalendarEvent"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"calendarEventTitle"},"name":{"kind":"Name","value":"title"}},{"kind":"Field","alias":{"kind":"Name","value":"calendarEventStatus"},"name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"time"}},{"kind":"Field","name":{"kind":"Name","value":"conferenceUrl"}},{"kind":"Field","name":{"kind":"Name","value":"isReadOnly"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupNotificationStateFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlNotification"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"eventType"}},{"kind":"Field","name":{"kind":"Name","value":"entityType"}},{"kind":"Field","name":{"kind":"Name","value":"entityId"}},{"kind":"Field","name":{"kind":"Name","value":"sent"}},{"kind":"Field","name":{"kind":"Name","value":"state"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"senderId"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupNotificationNavigationMetadataFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlNotifEvent"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlChannelMentionMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"channelMentionMessageId"},"name":{"kind":"Name","value":"messageId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMentionMessageContent"},"name":{"kind":"Name","value":"messageContent"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMentionThreadId"},"name":{"kind":"Name","value":"threadId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMentionChannelType"},"name":{"kind":"Name","value":"channelType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlDocumentMentionMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"documentMentionDocumentName"},"name":{"kind":"Name","value":"documentName"}},{"kind":"Field","alias":{"kind":"Name","value":"documentMentionOwner"},"name":{"kind":"Name","value":"owner"}},{"kind":"Field","alias":{"kind":"Name","value":"documentMentionFileType"},"name":{"kind":"Name","value":"fileType"}},{"kind":"Field","alias":{"kind":"Name","value":"documentMentionSubType"},"name":{"kind":"Name","value":"subType"}},{"kind":"Field","alias":{"kind":"Name","value":"documentMentionMessageId"},"name":{"kind":"Name","value":"messageId"}},{"kind":"Field","alias":{"kind":"Name","value":"documentMentionMessageContent"},"name":{"kind":"Name","value":"messageContent"}},{"kind":"Field","alias":{"kind":"Name","value":"documentMentionHasAttachments"},"name":{"kind":"Name","value":"hasAttachments"}},{"kind":"Field","alias":{"kind":"Name","value":"documentMentionThreadId"},"name":{"kind":"Name","value":"threadId"}},{"kind":"Field","alias":{"kind":"Name","value":"documentMentionSenderDisplayName"},"name":{"kind":"Name","value":"senderDisplayName"}},{"kind":"Field","alias":{"kind":"Name","value":"documentMentionChannelType"},"name":{"kind":"Name","value":"channelType"}},{"kind":"Field","alias":{"kind":"Name","value":"documentMentionChannelName"},"name":{"kind":"Name","value":"channelName"}},{"kind":"Field","alias":{"kind":"Name","value":"documentMentionSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlMentionedInDocumentCommentMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"mentionedInDocumentCommentDocumentName"},"name":{"kind":"Name","value":"documentName"}},{"kind":"Field","alias":{"kind":"Name","value":"mentionedInDocumentCommentOwner"},"name":{"kind":"Name","value":"owner"}},{"kind":"Field","alias":{"kind":"Name","value":"mentionedInDocumentCommentFileType"},"name":{"kind":"Name","value":"fileType"}},{"kind":"Field","alias":{"kind":"Name","value":"mentionedInDocumentCommentSubType"},"name":{"kind":"Name","value":"subType"}},{"kind":"Field","alias":{"kind":"Name","value":"mentionedInDocumentCommentMentionId"},"name":{"kind":"Name","value":"mentionId"}},{"kind":"Field","alias":{"kind":"Name","value":"mentionedInDocumentCommentCommentId"},"name":{"kind":"Name","value":"commentId"}},{"kind":"Field","alias":{"kind":"Name","value":"mentionedInDocumentCommentThreadId"},"name":{"kind":"Name","value":"threadId"}},{"kind":"Field","alias":{"kind":"Name","value":"mentionedInDocumentCommentText"},"name":{"kind":"Name","value":"text"}},{"kind":"Field","alias":{"kind":"Name","value":"mentionedInDocumentCommentSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"mentionedInDocumentCommentSenderDisplayName"},"name":{"kind":"Name","value":"senderDisplayName"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlRepliedToDocumentCommentThreadMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"repliedToDocumentCommentThreadDocumentName"},"name":{"kind":"Name","value":"documentName"}},{"kind":"Field","alias":{"kind":"Name","value":"repliedToDocumentCommentThreadOwner"},"name":{"kind":"Name","value":"owner"}},{"kind":"Field","alias":{"kind":"Name","value":"repliedToDocumentCommentThreadFileType"},"name":{"kind":"Name","value":"fileType"}},{"kind":"Field","alias":{"kind":"Name","value":"repliedToDocumentCommentThreadSubType"},"name":{"kind":"Name","value":"subType"}},{"kind":"Field","alias":{"kind":"Name","value":"repliedToDocumentCommentThreadCommentId"},"name":{"kind":"Name","value":"commentId"}},{"kind":"Field","alias":{"kind":"Name","value":"repliedToDocumentCommentThreadThreadId"},"name":{"kind":"Name","value":"threadId"}},{"kind":"Field","alias":{"kind":"Name","value":"repliedToDocumentCommentThreadText"},"name":{"kind":"Name","value":"text"}},{"kind":"Field","alias":{"kind":"Name","value":"repliedToDocumentCommentThreadSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"repliedToDocumentCommentThreadSenderDisplayName"},"name":{"kind":"Name","value":"senderDisplayName"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlCommentedOnDocumentMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"commentedOnDocumentDocumentName"},"name":{"kind":"Name","value":"documentName"}},{"kind":"Field","alias":{"kind":"Name","value":"commentedOnDocumentOwner"},"name":{"kind":"Name","value":"owner"}},{"kind":"Field","alias":{"kind":"Name","value":"commentedOnDocumentFileType"},"name":{"kind":"Name","value":"fileType"}},{"kind":"Field","alias":{"kind":"Name","value":"commentedOnDocumentSubType"},"name":{"kind":"Name","value":"subType"}},{"kind":"Field","alias":{"kind":"Name","value":"commentedOnDocumentCommentId"},"name":{"kind":"Name","value":"commentId"}},{"kind":"Field","alias":{"kind":"Name","value":"commentedOnDocumentThreadId"},"name":{"kind":"Name","value":"threadId"}},{"kind":"Field","alias":{"kind":"Name","value":"commentedOnDocumentText"},"name":{"kind":"Name","value":"text"}},{"kind":"Field","alias":{"kind":"Name","value":"commentedOnDocumentSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"commentedOnDocumentSenderDisplayName"},"name":{"kind":"Name","value":"senderDisplayName"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlInitiativeDiscussionMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"initiativeDiscussionProjectName"},"name":{"kind":"Name","value":"projectName"}},{"kind":"Field","alias":{"kind":"Name","value":"initiativeDiscussionOwner"},"name":{"kind":"Name","value":"owner"}},{"kind":"Field","alias":{"kind":"Name","value":"initiativeDiscussionReason"},"name":{"kind":"Name","value":"reason"}},{"kind":"Field","alias":{"kind":"Name","value":"initiativeDiscussionMessageId"},"name":{"kind":"Name","value":"messageId"}},{"kind":"Field","alias":{"kind":"Name","value":"initiativeDiscussionThreadId"},"name":{"kind":"Name","value":"threadId"}},{"kind":"Field","alias":{"kind":"Name","value":"initiativeDiscussionText"},"name":{"kind":"Name","value":"text"}},{"kind":"Field","alias":{"kind":"Name","value":"initiativeDiscussionSenderDisplayName"},"name":{"kind":"Name","value":"senderDisplayName"}},{"kind":"Field","alias":{"kind":"Name","value":"initiativeDiscussionSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlCrmDiscussionMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"crmDiscussionRecordName"},"name":{"kind":"Name","value":"recordName"}},{"kind":"Field","alias":{"kind":"Name","value":"crmDiscussionReason"},"name":{"kind":"Name","value":"reason"}},{"kind":"Field","alias":{"kind":"Name","value":"crmDiscussionMessageId"},"name":{"kind":"Name","value":"messageId"}},{"kind":"Field","alias":{"kind":"Name","value":"crmDiscussionThreadId"},"name":{"kind":"Name","value":"threadId"}},{"kind":"Field","alias":{"kind":"Name","value":"crmDiscussionText"},"name":{"kind":"Name","value":"text"}},{"kind":"Field","alias":{"kind":"Name","value":"crmDiscussionSenderDisplayName"},"name":{"kind":"Name","value":"senderDisplayName"}},{"kind":"Field","alias":{"kind":"Name","value":"crmDiscussionSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlChannelInviteMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"channelInviteInvitedBy"},"name":{"kind":"Name","value":"invitedBy"}},{"kind":"Field","alias":{"kind":"Name","value":"channelInviteChannelName"},"name":{"kind":"Name","value":"channelName"}},{"kind":"Field","alias":{"kind":"Name","value":"channelInviteMessageContent"},"name":{"kind":"Name","value":"messageContent"}},{"kind":"Field","alias":{"kind":"Name","value":"channelInviteSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlChannelMessageSendMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"channelMessageSendSender"},"name":{"kind":"Name","value":"sender"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageSendMessageId"},"name":{"kind":"Name","value":"messageId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageSendChannelType"},"name":{"kind":"Name","value":"channelType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlChannelMessageReactionMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"channelMessageReactionMessageId"},"name":{"kind":"Name","value":"messageId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageReactionThreadId"},"name":{"kind":"Name","value":"threadId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageReactionMessageContent"},"name":{"kind":"Name","value":"messageContent"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageReactionEmoji"},"name":{"kind":"Name","value":"emoji"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageReactionChannelType"},"name":{"kind":"Name","value":"channelType"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageReactionChannelName"},"name":{"kind":"Name","value":"channelName"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageReactionSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlChannelReplyMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"channelReplyThreadId"},"name":{"kind":"Name","value":"threadId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelReplyMessageId"},"name":{"kind":"Name","value":"messageId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelReplyUserId"},"name":{"kind":"Name","value":"userId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelReplyMessageContent"},"name":{"kind":"Name","value":"messageContent"}},{"kind":"Field","alias":{"kind":"Name","value":"channelReplyThreadParentSenderId"},"name":{"kind":"Name","value":"threadParentSenderId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelReplyChannelType"},"name":{"kind":"Name","value":"channelType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlCallStartedMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"callStartedChannelName"},"name":{"kind":"Name","value":"channelName"}},{"kind":"Field","alias":{"kind":"Name","value":"callStartedSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlNewEmailMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"newEmailSender"},"name":{"kind":"Name","value":"sender"}},{"kind":"Field","alias":{"kind":"Name","value":"newEmailToEmail"},"name":{"kind":"Name","value":"toEmail"}},{"kind":"Field","alias":{"kind":"Name","value":"newEmailThreadId"},"name":{"kind":"Name","value":"threadId"}},{"kind":"Field","alias":{"kind":"Name","value":"newEmailSubject"},"name":{"kind":"Name","value":"subject"}},{"kind":"Field","alias":{"kind":"Name","value":"newEmailSnippet"},"name":{"kind":"Name","value":"snippet"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlInboxReauthRequiredMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"inboxReauthRequiredEmailAddress"},"name":{"kind":"Name","value":"emailAddress"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlInviteToTeamMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"inviteToTeamTeamName"},"name":{"kind":"Name","value":"teamName"}},{"kind":"Field","alias":{"kind":"Name","value":"inviteToTeamTeamId"},"name":{"kind":"Name","value":"teamId"}},{"kind":"Field","alias":{"kind":"Name","value":"inviteToTeamTeamInviteId"},"name":{"kind":"Name","value":"teamInviteId"}},{"kind":"Field","alias":{"kind":"Name","value":"inviteToTeamInvitedBy"},"name":{"kind":"Name","value":"invitedBy"}},{"kind":"Field","alias":{"kind":"Name","value":"inviteToTeamRole"},"name":{"kind":"Name","value":"role"}},{"kind":"Field","alias":{"kind":"Name","value":"inviteToTeamSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlTaskAssignedMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"taskAssignedTaskId"},"name":{"kind":"Name","value":"taskId"}},{"kind":"Field","alias":{"kind":"Name","value":"taskAssignedTaskName"},"name":{"kind":"Name","value":"taskName"}},{"kind":"Field","alias":{"kind":"Name","value":"taskAssignedSubType"},"name":{"kind":"Name","value":"subType"}},{"kind":"Field","alias":{"kind":"Name","value":"taskAssignedAssignedBy"},"name":{"kind":"Name","value":"assignedBy"}},{"kind":"Field","alias":{"kind":"Name","value":"taskAssignedSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlReminderMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"reminderReminderId"},"name":{"kind":"Name","value":"reminderId"}},{"kind":"Field","alias":{"kind":"Name","value":"reminderDescription"},"name":{"kind":"Name","value":"description"}},{"kind":"Field","alias":{"kind":"Name","value":"reminderScheduledFor"},"name":{"kind":"Name","value":"scheduledFor"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlCalendarEventReminderMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"calendarEventReminderEventId"},"name":{"kind":"Name","value":"eventId"}},{"kind":"Field","alias":{"kind":"Name","value":"calendarEventReminderOccurrenceKey"},"name":{"kind":"Name","value":"occurrenceKey"}},{"kind":"Field","alias":{"kind":"Name","value":"calendarEventReminderTitle"},"name":{"kind":"Name","value":"title"}},{"kind":"Field","alias":{"kind":"Name","value":"calendarEventReminderStartsAt"},"name":{"kind":"Name","value":"startsAt"}},{"kind":"Field","alias":{"kind":"Name","value":"calendarEventReminderEndsAt"},"name":{"kind":"Name","value":"endsAt"}},{"kind":"Field","alias":{"kind":"Name","value":"calendarEventReminderStartDate"},"name":{"kind":"Name","value":"startDate"}},{"kind":"Field","alias":{"kind":"Name","value":"calendarEventReminderTimeZone"},"name":{"kind":"Name","value":"timeZone"}},{"kind":"Field","alias":{"kind":"Name","value":"calendarEventReminderMinutesBefore"},"name":{"kind":"Name","value":"minutesBefore"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlAiResponseMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"aiResponseSummary"},"name":{"kind":"Name","value":"summary"}},{"kind":"Field","alias":{"kind":"Name","value":"aiResponseMessageId"},"name":{"kind":"Name","value":"messageId"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlGithubPrStatusChangedMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedForeignEntityId"},"name":{"kind":"Name","value":"foreignEntityId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedGithubKey"},"name":{"kind":"Name","value":"githubKey"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedOwner"},"name":{"kind":"Name","value":"owner"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedRepo"},"name":{"kind":"Name","value":"repo"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedNumber"},"name":{"kind":"Name","value":"number"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedUrl"},"name":{"kind":"Name","value":"url"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedDisplayName"},"name":{"kind":"Name","value":"displayName"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedTitle"},"name":{"kind":"Name","value":"title"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedSenderGithubLogin"},"name":{"kind":"Name","value":"senderGithubLogin"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedSenderGithubUserId"},"name":{"kind":"Name","value":"senderGithubUserId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedSenderGithubAvatarUrl"},"name":{"kind":"Name","value":"senderGithubAvatarUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedStatus"},"name":{"kind":"Name","value":"status"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedAction"},"name":{"kind":"Name","value":"action"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedPreviousStatus"},"name":{"kind":"Name","value":"previousStatus"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedHeadBranch"},"name":{"kind":"Name","value":"headBranch"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedBaseBranch"},"name":{"kind":"Name","value":"baseBranch"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedMergedAt"},"name":{"kind":"Name","value":"mergedAt"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlGithubPrCheckRunMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunForeignEntityId"},"name":{"kind":"Name","value":"foreignEntityId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunGithubKey"},"name":{"kind":"Name","value":"githubKey"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunOwner"},"name":{"kind":"Name","value":"owner"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunRepo"},"name":{"kind":"Name","value":"repo"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunNumber"},"name":{"kind":"Name","value":"number"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunUrl"},"name":{"kind":"Name","value":"url"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunDisplayName"},"name":{"kind":"Name","value":"displayName"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunTitle"},"name":{"kind":"Name","value":"title"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunSenderGithubLogin"},"name":{"kind":"Name","value":"senderGithubLogin"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunSenderGithubUserId"},"name":{"kind":"Name","value":"senderGithubUserId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunSenderGithubAvatarUrl"},"name":{"kind":"Name","value":"senderGithubAvatarUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunCheckRunGithubId"},"name":{"kind":"Name","value":"checkRunGithubId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunCheckName"},"name":{"kind":"Name","value":"checkName"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunCheckStatus"},"name":{"kind":"Name","value":"checkStatus"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunConclusion"},"name":{"kind":"Name","value":"conclusion"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunState"},"name":{"kind":"Name","value":"state"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunCheckUrl"},"name":{"kind":"Name","value":"checkUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunCompletedAt"},"name":{"kind":"Name","value":"completedAt"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlGithubReviewRequestedMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedForeignEntityId"},"name":{"kind":"Name","value":"foreignEntityId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedGithubKey"},"name":{"kind":"Name","value":"githubKey"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedOwner"},"name":{"kind":"Name","value":"owner"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedRepo"},"name":{"kind":"Name","value":"repo"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedNumber"},"name":{"kind":"Name","value":"number"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedUrl"},"name":{"kind":"Name","value":"url"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedDisplayName"},"name":{"kind":"Name","value":"displayName"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedTitle"},"name":{"kind":"Name","value":"title"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedSenderGithubLogin"},"name":{"kind":"Name","value":"senderGithubLogin"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedSenderGithubUserId"},"name":{"kind":"Name","value":"senderGithubUserId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedSenderGithubAvatarUrl"},"name":{"kind":"Name","value":"senderGithubAvatarUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedRequestedReviewerGithubLogin"},"name":{"kind":"Name","value":"requestedReviewerGithubLogin"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedRequestedReviewerGithubUserId"},"name":{"kind":"Name","value":"requestedReviewerGithubUserId"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlGithubPrCommentMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentForeignEntityId"},"name":{"kind":"Name","value":"foreignEntityId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentGithubKey"},"name":{"kind":"Name","value":"githubKey"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentOwner"},"name":{"kind":"Name","value":"owner"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentRepo"},"name":{"kind":"Name","value":"repo"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentNumber"},"name":{"kind":"Name","value":"number"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentUrl"},"name":{"kind":"Name","value":"url"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentDisplayName"},"name":{"kind":"Name","value":"displayName"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentTitle"},"name":{"kind":"Name","value":"title"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentSenderGithubLogin"},"name":{"kind":"Name","value":"senderGithubLogin"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentSenderGithubUserId"},"name":{"kind":"Name","value":"senderGithubUserId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentSenderGithubAvatarUrl"},"name":{"kind":"Name","value":"senderGithubAvatarUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentCommentKind"},"name":{"kind":"Name","value":"commentKind"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentCommentGithubId"},"name":{"kind":"Name","value":"commentGithubId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentCommentUrl"},"name":{"kind":"Name","value":"commentUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentCommentSnippet"},"name":{"kind":"Name","value":"commentSnippet"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlGithubPrMentionMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionForeignEntityId"},"name":{"kind":"Name","value":"foreignEntityId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionGithubKey"},"name":{"kind":"Name","value":"githubKey"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionOwner"},"name":{"kind":"Name","value":"owner"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionRepo"},"name":{"kind":"Name","value":"repo"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionNumber"},"name":{"kind":"Name","value":"number"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionUrl"},"name":{"kind":"Name","value":"url"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionDisplayName"},"name":{"kind":"Name","value":"displayName"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionTitle"},"name":{"kind":"Name","value":"title"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionSenderGithubLogin"},"name":{"kind":"Name","value":"senderGithubLogin"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionSenderGithubUserId"},"name":{"kind":"Name","value":"senderGithubUserId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionSenderGithubAvatarUrl"},"name":{"kind":"Name","value":"senderGithubAvatarUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionLocation"},"name":{"kind":"Name","value":"location"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionCommentGithubId"},"name":{"kind":"Name","value":"commentGithubId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionCommentUrl"},"name":{"kind":"Name","value":"commentUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionTextSnippet"},"name":{"kind":"Name","value":"textSnippet"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlGithubPrReviewMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewForeignEntityId"},"name":{"kind":"Name","value":"foreignEntityId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewGithubKey"},"name":{"kind":"Name","value":"githubKey"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewOwner"},"name":{"kind":"Name","value":"owner"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewRepo"},"name":{"kind":"Name","value":"repo"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewNumber"},"name":{"kind":"Name","value":"number"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewUrl"},"name":{"kind":"Name","value":"url"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewDisplayName"},"name":{"kind":"Name","value":"displayName"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewTitle"},"name":{"kind":"Name","value":"title"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewSenderGithubLogin"},"name":{"kind":"Name","value":"senderGithubLogin"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewSenderGithubUserId"},"name":{"kind":"Name","value":"senderGithubUserId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewSenderGithubAvatarUrl"},"name":{"kind":"Name","value":"senderGithubAvatarUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewReviewGithubId"},"name":{"kind":"Name","value":"reviewGithubId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewReviewUrl"},"name":{"kind":"Name","value":"reviewUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewState"},"name":{"kind":"Name","value":"state"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewReviewSnippet"},"name":{"kind":"Name","value":"reviewSnippet"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlAgentSessionSettledMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"agentSessionSettledSession"},"name":{"kind":"Name","value":"session"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"sessionId"}},{"kind":"Field","name":{"kind":"Name","value":"sessionName"}},{"kind":"Field","name":{"kind":"Name","value":"botId"}},{"kind":"Field","name":{"kind":"Name","value":"botName"}},{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"threadId"}},{"kind":"Field","name":{"kind":"Name","value":"announcementMessageId"}}]}},{"kind":"Field","alias":{"kind":"Name","value":"agentSessionSettledTurn"},"name":{"kind":"Name","value":"turn"}},{"kind":"Field","alias":{"kind":"Name","value":"agentSessionSettledActor"},"name":{"kind":"Name","value":"actor"}},{"kind":"Field","alias":{"kind":"Name","value":"agentSessionSettledStopReason"},"name":{"kind":"Name","value":"stopReason"}},{"kind":"Field","alias":{"kind":"Name","value":"agentSessionSettledExcerpt"},"name":{"kind":"Name","value":"excerpt"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlAgentSessionWaitingForInputMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"agentSessionWaitingForInputSession"},"name":{"kind":"Name","value":"session"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"sessionId"}},{"kind":"Field","name":{"kind":"Name","value":"sessionName"}},{"kind":"Field","name":{"kind":"Name","value":"botId"}},{"kind":"Field","name":{"kind":"Name","value":"botName"}},{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"threadId"}},{"kind":"Field","name":{"kind":"Name","value":"announcementMessageId"}}]}},{"kind":"Field","alias":{"kind":"Name","value":"agentSessionWaitingForInputTurn"},"name":{"kind":"Name","value":"turn"}},{"kind":"Field","alias":{"kind":"Name","value":"agentSessionWaitingForInputQuestion"},"name":{"kind":"Name","value":"question"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlAgentSessionMentionedMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"agentSessionMentionedSession"},"name":{"kind":"Name","value":"session"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"sessionId"}},{"kind":"Field","name":{"kind":"Name","value":"sessionName"}},{"kind":"Field","name":{"kind":"Name","value":"botId"}},{"kind":"Field","name":{"kind":"Name","value":"botName"}},{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"threadId"}},{"kind":"Field","name":{"kind":"Name","value":"announcementMessageId"}}]}},{"kind":"Field","alias":{"kind":"Name","value":"agentSessionMentionedMentionedBy"},"name":{"kind":"Name","value":"mentionedBy"}},{"kind":"Field","alias":{"kind":"Name","value":"agentSessionMentionedActionId"},"name":{"kind":"Name","value":"actionId"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupNotificationMetadataFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlNotifEvent"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupNotificationNavigationMetadataFields"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlChannelMentionMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"channelMentionHasAttachments"},"name":{"kind":"Name","value":"hasAttachments"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMentionSenderDisplayName"},"name":{"kind":"Name","value":"senderDisplayName"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMentionChannelName"},"name":{"kind":"Name","value":"channelName"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMentionSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlChannelMessageSendMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"channelMessageSendMessageContent"},"name":{"kind":"Name","value":"messageContent"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageSendHasAttachments"},"name":{"kind":"Name","value":"hasAttachments"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageSendSenderDisplayName"},"name":{"kind":"Name","value":"senderDisplayName"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageSendChannelName"},"name":{"kind":"Name","value":"channelName"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageSendSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlChannelReplyMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"channelReplyHasAttachments"},"name":{"kind":"Name","value":"hasAttachments"}},{"kind":"Field","alias":{"kind":"Name","value":"channelReplySenderDisplayName"},"name":{"kind":"Name","value":"senderDisplayName"}},{"kind":"Field","alias":{"kind":"Name","value":"channelReplyChannelName"},"name":{"kind":"Name","value":"channelName"}},{"kind":"Field","alias":{"kind":"Name","value":"channelReplySenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupNotificationFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlNotification"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupNotificationStateFields"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupNotificationMetadataFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupItemFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupEntity"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupItemPreviewFields"}},{"kind":"Field","name":{"kind":"Name","value":"notifications"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupNotificationFields"}}]}}]}}]} as unknown as DocumentNode<GroupSoupQuery, GroupSoupQueryVariables>;
+export const HomeUnreadPresenceDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"HomeUnreadPresence"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"SoupInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"user"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"soup"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}},{"kind":"Field","alias":{"kind":"Name","value":"unreadNotifications"},"name":{"kind":"Name","value":"notifications"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filter"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"states"},"value":{"kind":"ListValue","values":[{"kind":"EnumValue","value":"UNSEEN"}]}},{"kind":"ObjectField","name":{"kind":"Name","value":"channelFeedOnly"},"value":{"kind":"BooleanValue","value":true}}]}},{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"IntValue","value":"1"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"state"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupDocument"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"subType"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupEmailThread"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"isRead"}},{"kind":"Field","name":{"kind":"Name","value":"inboxVisible"}},{"kind":"Field","name":{"kind":"Name","value":"isDraft"}},{"kind":"Field","name":{"kind":"Name","value":"sortTs"}},{"kind":"Field","name":{"kind":"Name","value":"labels"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"providerLabelId"}}]}},{"kind":"Field","alias":{"kind":"Name","value":"unreadReminders"},"name":{"kind":"Name","value":"notifications"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filter"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"states"},"value":{"kind":"ListValue","values":[{"kind":"EnumValue","value":"UNSEEN"}]}},{"kind":"ObjectField","name":{"kind":"Name","value":"eventTypes"},"value":{"kind":"ListValue","values":[{"kind":"StringValue","value":"reminder","block":false}]}}]}},{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"IntValue","value":"1"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"state"}}]}}]}}]}}]}}]}}]}}]} as unknown as DocumentNode<HomeUnreadPresenceQuery, HomeUnreadPresenceQueryVariables>;
export const InitiativeDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"Initiative"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"initiativeId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"user"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"initiative"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"initiativeId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"initiativeId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"InitiativeDetailFields"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupPropertyValueFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlBooleanPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"boolValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlNumberPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"numberValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlStringPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"stringValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlDatePropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"dateValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSelectOptionPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"optionIds"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlEntityReferencePropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"references"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"entityId"}},{"kind":"Field","name":{"kind":"Name","value":"entityType"}},{"kind":"Field","name":{"kind":"Name","value":"specificMessageId"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlLinkPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"urls"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupPropertyFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlProperty"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"propertyDefinitionId"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"dataType"}},{"kind":"Field","name":{"kind":"Name","value":"isMultiSelect"}},{"kind":"Field","name":{"kind":"Name","value":"specificEntityType"}},{"kind":"Field","name":{"kind":"Name","value":"isSystem"}},{"kind":"Field","name":{"kind":"Name","value":"isMetadata"}},{"kind":"Field","name":{"kind":"Name","value":"value"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyValueFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"InitiativeDetailFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupInitiative"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"viewerPermission"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlAccessLevelPermission"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"accessLevel"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"taskCount"}},{"kind":"Field","name":{"kind":"Name","value":"completedTaskCount"}},{"kind":"Field","name":{"kind":"Name","value":"memberIds"}},{"kind":"Field","name":{"kind":"Name","value":"taskIds"}},{"kind":"Field","name":{"kind":"Name","value":"sharePermission"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"owner"}},{"kind":"Field","name":{"kind":"Name","value":"linkShare"}},{"kind":"Field","name":{"kind":"Name","value":"linkShareAccessLevel"}},{"kind":"Field","name":{"kind":"Name","value":"teamShareAccessLevel"}},{"kind":"Field","name":{"kind":"Name","value":"channelSharePermissions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"accessLevel"}}]}}]}}]}}]} as unknown as DocumentNode<InitiativeQuery, InitiativeQueryVariables>;
export const CreateInitiativeDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"CreateInitiative"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"CreateInitiativeInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"createInitiative"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"InitiativeDetailFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupPropertyValueFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlBooleanPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"boolValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlNumberPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"numberValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlStringPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"stringValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlDatePropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"dateValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSelectOptionPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"optionIds"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlEntityReferencePropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"references"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"entityId"}},{"kind":"Field","name":{"kind":"Name","value":"entityType"}},{"kind":"Field","name":{"kind":"Name","value":"specificMessageId"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlLinkPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"urls"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupPropertyFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlProperty"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"propertyDefinitionId"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"dataType"}},{"kind":"Field","name":{"kind":"Name","value":"isMultiSelect"}},{"kind":"Field","name":{"kind":"Name","value":"specificEntityType"}},{"kind":"Field","name":{"kind":"Name","value":"isSystem"}},{"kind":"Field","name":{"kind":"Name","value":"isMetadata"}},{"kind":"Field","name":{"kind":"Name","value":"value"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyValueFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"InitiativeDetailFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupInitiative"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"viewerPermission"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlAccessLevelPermission"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"accessLevel"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"taskCount"}},{"kind":"Field","name":{"kind":"Name","value":"completedTaskCount"}},{"kind":"Field","name":{"kind":"Name","value":"memberIds"}},{"kind":"Field","name":{"kind":"Name","value":"taskIds"}},{"kind":"Field","name":{"kind":"Name","value":"sharePermission"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"owner"}},{"kind":"Field","name":{"kind":"Name","value":"linkShare"}},{"kind":"Field","name":{"kind":"Name","value":"linkShareAccessLevel"}},{"kind":"Field","name":{"kind":"Name","value":"teamShareAccessLevel"}},{"kind":"Field","name":{"kind":"Name","value":"channelSharePermissions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"accessLevel"}}]}}]}}]}}]} as unknown as DocumentNode<CreateInitiativeMutation, CreateInitiativeMutationVariables>;
export const UpdateInitiativeDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"UpdateInitiative"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"initiativeId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UpdateInitiativeInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"updateInitiative"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"initiativeId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"initiativeId"}}},{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"InitiativeDetailFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupPropertyValueFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlBooleanPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"boolValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlNumberPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"numberValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlStringPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"stringValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlDatePropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"dateValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSelectOptionPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"optionIds"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlEntityReferencePropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"references"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"entityId"}},{"kind":"Field","name":{"kind":"Name","value":"entityType"}},{"kind":"Field","name":{"kind":"Name","value":"specificMessageId"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlLinkPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"urls"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupPropertyFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlProperty"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"propertyDefinitionId"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"dataType"}},{"kind":"Field","name":{"kind":"Name","value":"isMultiSelect"}},{"kind":"Field","name":{"kind":"Name","value":"specificEntityType"}},{"kind":"Field","name":{"kind":"Name","value":"isSystem"}},{"kind":"Field","name":{"kind":"Name","value":"isMetadata"}},{"kind":"Field","name":{"kind":"Name","value":"value"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyValueFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"InitiativeDetailFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupInitiative"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"viewerPermission"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlAccessLevelPermission"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"accessLevel"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"taskCount"}},{"kind":"Field","name":{"kind":"Name","value":"completedTaskCount"}},{"kind":"Field","name":{"kind":"Name","value":"memberIds"}},{"kind":"Field","name":{"kind":"Name","value":"taskIds"}},{"kind":"Field","name":{"kind":"Name","value":"sharePermission"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"owner"}},{"kind":"Field","name":{"kind":"Name","value":"linkShare"}},{"kind":"Field","name":{"kind":"Name","value":"linkShareAccessLevel"}},{"kind":"Field","name":{"kind":"Name","value":"teamShareAccessLevel"}},{"kind":"Field","name":{"kind":"Name","value":"channelSharePermissions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"accessLevel"}}]}}]}}]}}]} as unknown as DocumentNode<UpdateInitiativeMutation, UpdateInitiativeMutationVariables>;
diff --git a/apps/web/src/lib/service-clients/service-storage/graphql/home-unread.graphql b/apps/web/src/lib/service-clients/service-storage/graphql/home-unread.graphql
new file mode 100644
index 0000000000..d41a526e15
--- /dev/null
+++ b/apps/web/src/lib/service-clients/service-storage/graphql/home-unread.graphql
@@ -0,0 +1,32 @@
+# Presence only: never use these bounded edges as full notification history or
+# as the input to mark-read/done actions. Keep the shared Soup document unchanged.
+query HomeUnreadPresence($input: SoupInput!) {
+ user {
+ id
+ soup(input: $input) {
+ items {
+ __typename
+ id
+ metadata { createdAt updatedAt }
+ unreadNotifications: notifications(
+ filter: { states: [UNSEEN], channelFeedOnly: true }
+ limit: 1
+ ) { id state }
+ ... on GraphqlSoupDocument {
+ subType { __typename }
+ }
+ ... on GraphqlSoupEmailThread {
+ isRead
+ inboxVisible
+ isDraft
+ sortTs
+ labels { id name providerLabelId }
+ unreadReminders: notifications(
+ filter: { states: [UNSEEN], eventTypes: ["reminder"] }
+ limit: 1
+ ) { id state }
+ }
+ }
+ }
+ }
+}
diff --git a/crates/graphql_notification/src/loaders/test.rs b/crates/graphql_notification/src/loaders/test.rs
index e2f0b4a0b3..f715114ff9 100644
--- a/crates/graphql_notification/src/loaders/test.rs
+++ b/crates/graphql_notification/src/loaders/test.rs
@@ -101,6 +101,7 @@ async fn aliases_and_entities_batch_without_mixing_full_and_limited_results() {
.execute(
r#"{
roots: notifications(entity: "one", filter: {states: [UNSEEN], topLevelMessagesOnly: true}, limit: 1) { id state }
+ feed: notifications(entity: "one", filter: {states: [UNSEEN], channelFeedOnly: true}, limit: 1) { id state }
full: notifications(entity: "one") { id state }
unread: notifications(entity: "one", filter: {states: [UNSEEN]}, limit: 1) { id state }
other: notifications(entity: "two", filter: {states: [UNSEEN]}, limit: 1) { id state }
@@ -114,7 +115,12 @@ async fn aliases_and_entities_batch_without_mixing_full_and_limited_results() {
assert_eq!(json["unread"][0]["state"], "UNSEEN");
assert_eq!(json["other"].as_array().unwrap().len(), 1);
let calls = calls.lock().unwrap();
- assert_eq!(calls.len(), 3, "one batch per selection, not per entity");
+ assert_eq!(calls.len(), 4, "one batch per selection, not per entity");
+ assert!(
+ calls
+ .iter()
+ .any(|(_, _, query)| query.channel_feed_only && query.limit == Some(1))
+ );
assert!(
calls
.iter()
@@ -123,7 +129,9 @@ async fn aliases_and_entities_batch_without_mixing_full_and_limited_results() {
assert_eq!(
calls
.iter()
- .find(|(_, _, query)| query.limit == Some(1) && !query.top_level_messages_only)
+ .find(|(_, _, query)| query.limit == Some(1)
+ && !query.top_level_messages_only
+ && !query.channel_feed_only)
.unwrap()
.1
.len(),
diff --git a/crates/graphql_notification/src/query.rs b/crates/graphql_notification/src/query.rs
index 3f93aa9f18..1cebc5e32c 100644
--- a/crates/graphql_notification/src/query.rs
+++ b/crates/graphql_notification/src/query.rs
@@ -14,6 +14,10 @@ pub struct GraphqlNotificationFilter {
pub event_types: Option<Vec<String>>,
/// Only notifications about top-level channel messages, including mentions but excluding reactions.
pub top_level_messages_only: Option<bool>,
+ /// Scope channel edges to their feed row rather than thread/mention stacks.
+ /// Scoping includes active seen reasons. Other entity edges are unchanged.
+ /// Applied before the edge limit.
+ pub channel_feed_only: Option<bool>,
}
impl GraphqlNotificationFilter {
@@ -28,6 +32,7 @@ impl GraphqlNotificationFilter {
}
query.event_types = self.event_types.unwrap_or_default();
query.top_level_messages_only = self.top_level_messages_only.unwrap_or_default();
+ query.channel_feed_only = self.channel_feed_only.unwrap_or_default();
query.limit = limit
.map(u32::try_from)
.transpose()
diff --git a/crates/notification/src/domain/models/entity_query.rs b/crates/notification/src/domain/models/entity_query.rs
index 7614604392..8cca099250 100644
--- a/crates/notification/src/domain/models/entity_query.rs
+++ b/crates/notification/src/domain/models/entity_query.rs
@@ -13,6 +13,11 @@ pub struct EntityNotificationQuery {
/// Only notifications about channel messages outside a thread, including mentions
/// but excluding reactions. Apply before limiting so replies cannot hide unread roots.
pub top_level_messages_only: bool,
+ /// Scope channel edges to their feed row, excluding notifications assigned to
+ /// thread/mention stacks. Active seen reasons participate in scoping too;
+ /// duplicate sends/replies represented by mentions stay in the feed. Other
+ /// entity edges are unchanged. Applied before the per-entity limit.
+ pub channel_feed_only: bool,
/// Maximum records per entity, newest first. None preserves the full edge.
pub limit: Option<u32>,
}
@@ -23,6 +28,7 @@ impl Default for EntityNotificationQuery {
states: NotificationState::ACTIVE.to_vec(),
event_types: Vec::new(),
top_level_messages_only: false,
+ channel_feed_only: false,
limit: None,
}
}
diff --git a/crates/notification/src/domain/models/entity_query/test.rs b/crates/notification/src/domain/models/entity_query/test.rs
index 150f08c652..08e72d1d39 100644
--- a/crates/notification/src/domain/models/entity_query/test.rs
+++ b/crates/notification/src/domain/models/entity_query/test.rs
@@ -5,6 +5,7 @@ fn default_is_active_and_unlimited_but_explicit_limits_are_bounded() {
let default = EntityNotificationQuery::default();
assert_eq!(default.states, NotificationState::ACTIVE);
assert_eq!(default.limit, None);
+ assert!(!default.channel_feed_only);
assert!(default.validate().is_ok());
for limit in [0, 501, u32::MAX] {
assert!(
diff --git a/crates/notification/src/outbound/entity_notifications.rs b/crates/notification/src/outbound/entity_notifications.rs
index 84b054503d..3eca755579 100644
--- a/crates/notification/src/outbound/entity_notifications.rs
+++ b/crates/notification/src/outbound/entity_notifications.rs
@@ -38,6 +38,28 @@ pub(super) async fn get_filtered_entity_notifications(
let limit = query.limit.map(i64::from);
let rows = sqlx::query!(
r#"
+ WITH requested AS (
+ SELECT entity_id, entity_type
+ FROM unnest($2::text[], $3::text[]) AS entities(entity_id, entity_type)
+ ),
+ -- Scope uses all active notifications, not just the requested states: a
+ -- seen reply still assigns an unseen root send to its thread row.
+ -- Build scope evidence once per batch, never rescan history per send.
+ channel_scopes AS MATERIALIZED (
+ SELECT DISTINCT n.event_item_id AS channel_id,
+ CASE WHEN n.notification_event_type = 'channel_mention'
+ THEN COALESCE(n.metadata->>'messageId', n.metadata->>'message_id')
+ END AS mentioned_message_id,
+ COALESCE(n.metadata->>'threadId', n.metadata->>'thread_id') AS thread_id
+ FROM requested
+ JOIN notification n
+ ON n.event_item_id = requested.entity_id AND n.event_item_type = 'channel'
+ JOIN user_notification un ON un.notification_id = n.id
+ WHERE $8::bool AND requested.entity_type = 'channel'
+ AND un.user_id = $1 AND un.deleted_at IS NULL
+ AND un.state = ANY($9::notification_state[])
+ AND n.notification_event_type IN ('channel_mention', 'channel_message_reply')
+ )
SELECT requested.entity_id AS "requested_id!",
requested.entity_type AS "requested_type!",
matched.notification_id AS "notification_id!",
@@ -50,7 +72,7 @@ pub(super) async fn get_filtered_entity_notifications(
matched.viewed_at,
matched.notification_metadata,
matched.sender_id
- FROM unnest($2::text[], $3::text[]) requested(entity_id, entity_type)
+ FROM requested
CROSS JOIN LATERAL (
SELECT un.notification_id, n.event_item_id, n.event_item_type,
n.notification_event_type, un.sent, un.state,
@@ -78,12 +100,37 @@ pub(super) async fn get_filtered_entity_notifications(
n.notification_event_type IN ('channel_message_send', 'channel_mention', 'document_mention')
AND COALESCE(n.metadata->>'threadId', n.metadata->>'thread_id') IS NULL
))
+ AND (NOT $8::bool OR requested.entity_type <> 'channel' OR (
+ n.notification_event_type = 'document_mention'
+ OR (n.notification_event_type IN ('channel_message_send', 'channel_message_reply') AND (
+ -- Mention stacks consume the mention, not its duplicate send/reply.
+ EXISTS (
+ SELECT 1 FROM channel_scopes scope
+ WHERE scope.channel_id = n.event_item_id
+ AND scope.mentioned_message_id = COALESCE(n.metadata->>'messageId', n.metadata->>'message_id')
+ )
+ OR (n.notification_event_type = 'channel_message_send' AND NOT EXISTS (
+ SELECT 1 FROM channel_scopes scope
+ WHERE scope.channel_id = n.event_item_id AND scope.thread_id <> ''
+ AND scope.thread_id = COALESCE(n.metadata->>'messageId', n.metadata->>'message_id')
+ ))
+ OR (n.notification_event_type = 'channel_message_reply'
+ AND NULLIF(COALESCE(n.metadata->>'threadId', n.metadata->>'thread_id'), '') IS NULL)
+ ))
+ OR (n.notification_event_type = 'channel_mention' AND (
+ COALESCE(n.metadata->>'threadId', n.metadata->>'thread_id') = ''
+ OR (COALESCE(n.metadata->>'threadId', n.metadata->>'thread_id') IS NULL
+ AND COALESCE(n.metadata->>'messageId', n.metadata->>'message_id') = ''
+ AND EXISTS (SELECT 1 FROM channel_scopes scope
+ WHERE scope.channel_id = n.event_item_id AND scope.thread_id = ''))
+ ))
+ ))
ORDER BY un.created_at DESC, un.notification_id DESC
LIMIT $6
) matched
"#,
user_id.as_ref(), &ids, &types, &query.states as _, &query.event_types, limit,
- query.top_level_messages_only,
+ query.top_level_messages_only, query.channel_feed_only, NotificationState::ACTIVE as _,
).fetch_all(pool).await?;
for row in rows {
diff --git a/crates/notification/src/outbound/entity_notifications/test.rs b/crates/notification/src/outbound/entity_notifications/test.rs
index f1d268f3c4..ad56da1421 100644
--- a/crates/notification/src/outbound/entity_notifications/test.rs
+++ b/crates/notification/src/outbound/entity_notifications/test.rs
@@ -322,3 +322,260 @@ async fn top_level_filter_finds_older_mentions_before_limiting(pool: PgPool) {
.any(|row| row.notification_id == reply && row.state == NotificationState::Unseen)
);
}
+
+#[derive(Clone, Serialize, Deserialize)]
+#[serde(rename_all = "camelCase")]
+struct Reply {
+ message_id: String,
+ thread_id: String,
+}
+impl Notification for Reply {
+ const TYPE_NAME: &'static str = "channel_message_reply";
+}
+
+#[sqlx::test(migrator = "MACRO_DB_MIGRATIONS")]
+async fn channel_feed_scope_excludes_thread_roots_before_the_limit(pool: PgPool) {
+ let viewer = MacroUserIdStr::try_from_email("[email protected]").unwrap();
+ let channel = EntityType::Channel.with_entity_string(Uuid::now_v7().to_string());
+ let witness = insert(
+ &pool,
+ &viewer,
+ channel.clone(),
+ None,
+ Message {
+ message_id: "unthreaded".into(),
+ },
+ )
+ .await;
+ for root in ["replied", "thread-mentioned"] {
+ insert(
+ &pool,
+ &viewer,
+ channel.clone(),
+ None,
+ Message {
+ message_id: root.into(),
+ },
+ )
+ .await;
+ }
+ let seen_reply = insert(
+ &pool,
+ &viewer,
+ channel.clone(),
+ None,
+ Reply {
+ message_id: "reply".into(),
+ thread_id: "replied".into(),
+ },
+ )
+ .await;
+ let seen_mention = insert(
+ &pool,
+ &viewer,
+ channel.clone(),
+ None,
+ Mention {
+ message_id: "mention-without-send".into(),
+ thread_id: None,
+ },
+ )
+ .await;
+ let legacy_mention = insert(
+ &pool,
+ &viewer,
+ channel.clone(),
+ None,
+ LegacyMention {
+ message_id: "legacy-reply".into(),
+ thread_id: "thread-mentioned".into(),
+ },
+ )
+ .await;
+ pool.mark_notifications_seen(&viewer, &[seen_reply, seen_mention, legacy_mention])
+ .await
+ .unwrap();
+ insert(
+ &pool,
+ &viewer,
+ channel.clone(),
+ None,
+ Reaction {
+ message_id: "unthreaded".into(),
+ },
+ )
+ .await;
+ insert(&pool, &viewer, channel.clone(), None, Call).await;
+ let query = EntityNotificationQuery {
+ states: vec![NotificationState::Unseen],
+ channel_feed_only: true,
+ limit: Some(1),
+ ..Default::default()
+ };
+ let read = || {
+ get_filtered_entity_notifications(
+ &pool,
+ viewer.clone(),
+ vec![channel.clone()],
+ query.clone(),
+ )
+ };
+ let rows = read().await.unwrap();
+ assert_eq!(rows[&channel].len(), 1);
+ assert_eq!(rows[&channel][0].notification_id, witness);
+ pool.mark_notifications_seen(&viewer, &[witness])
+ .await
+ .unwrap();
+ assert!(
+ read().await.unwrap()[&channel].is_empty(),
+ "unseen roots already assigned to threads cannot badge the channel feed"
+ );
+
+ // Completing the thread's last active reason releases its root to the feed.
+ pool.mark_notifications_done(&viewer, &[seen_reply], true)
+ .await
+ .unwrap();
+ assert_eq!(
+ read().await.unwrap()[&channel][0].notification_metadata["messageId"],
+ "replied"
+ );
+ let full =
+ get_filtered_entity_notifications(&pool, viewer, vec![channel.clone()], Default::default())
+ .await
+ .unwrap();
+ assert_eq!(
+ full[&channel].len(),
+ 7,
+ "the unfiltered edge still contains all active history"
+ );
+}
+
+#[sqlx::test(migrator = "MACRO_DB_MIGRATIONS")]
+async fn channel_feed_scoping_is_viewer_and_channel_local_and_ignores_deleted_reasons(
+ pool: PgPool,
+) {
+ let viewer = MacroUserIdStr::try_from_email("[email protected]").unwrap();
+ let other = MacroUserIdStr::try_from_email("[email protected]").unwrap();
+ let channel = EntityType::Channel.with_entity_string(Uuid::now_v7().to_string());
+ let another = EntityType::Channel.with_entity_string(Uuid::now_v7().to_string());
+ let witness = insert(
+ &pool,
+ &viewer,
+ channel.clone(),
+ None,
+ Message {
+ message_id: "root".into(),
+ },
+ )
+ .await;
+ let reply = Reply {
+ message_id: "reply".into(),
+ thread_id: "root".into(),
+ };
+ insert(&pool, &other, channel.clone(), None, reply.clone()).await;
+ insert(&pool, &viewer, another.clone(), None, reply.clone()).await;
+ let deleted = insert(&pool, &viewer, channel.clone(), None, reply).await;
+ pool.delete_user_notification(viewer.clone(), deleted)
+ .await
+ .unwrap();
+ let rows = get_filtered_entity_notifications(
+ &pool,
+ viewer,
+ vec![channel.clone(), another.clone()],
+ EntityNotificationQuery {
+ states: vec![NotificationState::Unseen],
+ channel_feed_only: true,
+ limit: Some(1),
+ ..Default::default()
+ },
+ )
+ .await
+ .unwrap();
+ assert_eq!(rows[&channel][0].notification_id, witness);
+ assert!(
+ rows[&another].is_empty(),
+ "a reply alone is not channel-feed activity"
+ );
+}
+
+#[sqlx::test(migrator = "MACRO_DB_MIGRATIONS")]
+async fn channel_feed_preserves_mention_duplicates_and_does_not_scope_thread_edges(pool: PgPool) {
+ let viewer = MacroUserIdStr::try_from_email("[email protected]").unwrap();
+ let channel = EntityType::Channel.with_entity_string(Uuid::now_v7().to_string());
+ let thread = EntityType::ChannelMessage.with_entity_string("root".to_owned());
+ let root = insert(
+ &pool,
+ &viewer,
+ channel.clone(),
+ None,
+ Message {
+ message_id: "root".into(),
+ },
+ )
+ .await;
+ let reply = insert(
+ &pool,
+ &viewer,
+ channel.clone(),
+ Some(thread.clone()),
+ Reply {
+ message_id: "reply".into(),
+ thread_id: "root".into(),
+ },
+ )
+ .await;
+ let root_mention = insert(
+ &pool,
+ &viewer,
+ channel.clone(),
+ None,
+ Mention {
+ message_id: "root".into(),
+ thread_id: None,
+ },
+ )
+ .await;
+ let reply_mention = insert(
+ &pool,
+ &viewer,
+ channel.clone(),
+ Some(thread.clone()),
+ Mention {
+ message_id: "reply".into(),
+ thread_id: Some("root".into()),
+ },
+ )
+ .await;
+ pool.mark_notifications_seen(&viewer, &[root_mention, reply_mention])
+ .await
+ .unwrap();
+ let query = EntityNotificationQuery {
+ states: vec![NotificationState::Unseen],
+ channel_feed_only: true,
+ limit: Some(1),
+ ..Default::default()
+ };
+ let rows = get_filtered_entity_notifications(
+ &pool,
+ viewer.clone(),
+ vec![channel.clone(), thread.clone()],
+ query.clone(),
+ )
+ .await
+ .unwrap();
+ assert_eq!(
+ rows[&channel][0].notification_id, reply,
+ "Home assigns the mention rather than its duplicate reply to the thread"
+ );
+ assert_eq!(
+ rows[&thread][0].notification_id, reply,
+ "non-channel edges keep their existing scope"
+ );
+ pool.mark_notifications_seen(&viewer, &[reply])
+ .await
+ .unwrap();
+ let rows = get_filtered_entity_notifications(&pool, viewer, vec![channel.clone()], query)
+ .await
+ .unwrap();
+ assert_eq!(rows[&channel][0].notification_id, root);
+}
diff --git a/docs/AGENT_GUIDE/navigation.md b/docs/AGENT_GUIDE/navigation.md
index e510c03b6a..7f03773972 100644
--- a/docs/AGENT_GUIDE/navigation.md
+++ b/docs/AGENT_GUIDE/navigation.md
@@ -338,8 +338,18 @@ use the standard 400 ms hover delay and 300 ms grace period between items. Home,
Email, and Chat show a small accent dot when the loaded data contains an unread
item. Home uses Signal; Email uses Important across all linked inboxes.
Noise does not light either dot. These are presence indicators, not counts; they
-do not fetch additional pages to find every unread item. Opening a view alone does
-not clear its dot — reading or completing the represented items does. The button's
+do not fetch additional pages to find every unread item. With GraphQL enabled,
+Home uses `HomeUnreadPresence` over its existing 100-item Signal/unread candidate
+page, with one state-only notification witness per entity (plus one reminder
+witness for email). It must not fetch full notification history just to draw the
+dot. Channel/thread scoping happens before the witness limit; seen thread reasons
+still affect that scoping. Reading or completing a witness refreshes the bounded
+edge so an older unread item can keep the dot lit. These witnesses must never be
+used as the complete mark-read/done input. The experimental notification-time
+sort remains on its existing REST path; disabling GraphQL or enabling that sort
+must not construct an unsupported GraphQL input or blank the app shell.
+Opening a view alone does not clear its dot — reading or completing the represented
+items does. The button's
accessible description is `Unread items` while its dot is active.
The Home dot stops checking rows at the first eligible unread item, using the
same Signal membership, channel/thread scoping, and local read/done overrides as
diff --git a/static_assets/schema.graphql b/static_assets/schema.graphql
index 8cb96c6242..ac0573a79b 100644
--- a/static_assets/schema.graphql
+++ b/static_assets/schema.graphql
@@ -5232,6 +5232,12 @@ input GraphqlNotificationFilter {
Only notifications about top-level channel messages, including mentions but excluding reactions.
"""
topLevelMessagesOnly: Boolean
+ """
+ Scope channel edges to their feed row rather than thread/mention stacks.
+ Scoping includes active seen reasons. Other entity edges are unchanged.
+ Applied before the edge limit.
+ """
+ channelFeedOnly: Boolean
}
"""