Skip to content

Commit fba5619

Browse files
committed
Harden managed Matrix release readiness
1 parent 2ca3dcc commit fba5619

77 files changed

Lines changed: 6356 additions & 292 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,9 @@ jobs:
2424
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
2525

2626
- name: Install Rust toolchain
27-
uses: dtolnay/rust-toolchain@387aeee55b189f024a4f6d94890c5b18d73339cc # 1.92.0
27+
uses: dtolnay/rust-toolchain@387aeee55b189f024a4f6d94890c5b18d73339cc
2828
with:
29+
toolchain: 1.93.0
2930
components: clippy, rustfmt
3031

3132
- name: Install system dependencies (Linux)
@@ -77,7 +78,9 @@ jobs:
7778
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
7879

7980
- name: Install Rust toolchain
80-
uses: dtolnay/rust-toolchain@387aeee55b189f024a4f6d94890c5b18d73339cc # 1.92.0
81+
uses: dtolnay/rust-toolchain@387aeee55b189f024a4f6d94890c5b18d73339cc
82+
with:
83+
toolchain: 1.93.0
8184

8285
- name: Install system dependencies
8386
run: |
@@ -149,6 +152,17 @@ jobs:
149152
working-directory: mesh
150153
run: npm run check:icons
151154

155+
- name: Check homeserver recovery scripts
156+
working-directory: mesh
157+
run: |
158+
shellcheck -e SC1007 infra/homeserver/*.sh infra/homeserver/tests/*.sh
159+
sh infra/homeserver/tests/backup-tools.test.sh
160+
python -m unittest discover -s infra/homeserver/tests -p 'test_admission_service.py' -v
161+
cp infra/homeserver/.env.example infra/homeserver/.env
162+
trap 'rm -f infra/homeserver/.env' EXIT
163+
docker compose \
164+
-f infra/homeserver/docker-compose.yml config --quiet
165+
152166
- name: Run tests
153167
working-directory: mesh
154168
run: npm run test

.github/workflows/matrix-federation-acceptance.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,10 @@ jobs:
3737
cache: npm
3838
cache-dependency-path: mesh/package-lock.json
3939

40-
- name: Install Rust 1.92
41-
uses: dtolnay/rust-toolchain@387aeee55b189f024a4f6d94890c5b18d73339cc # 1.92.0
40+
- name: Install Rust 1.93
41+
uses: dtolnay/rust-toolchain@387aeee55b189f024a4f6d94890c5b18d73339cc
42+
with:
43+
toolchain: 1.93.0
4244

4345
- name: Install Matrix test build dependencies
4446
run: |

.github/workflows/nightly-soak.yml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ name: Nightly Soak
77
# 1. All 13 live libp2p tests (~70s)
88
# 2. 60-second leak-detection soak (Phase A baseline + Phase B churn)
99
# 3. 45-second topology churn soak
10+
# 4. A real PostgreSQL dump and isolated Synapse restore drill
1011
#
1112
# Total runtime: ~4 minutes per run.
1213
#
@@ -35,6 +36,19 @@ env:
3536
RUST_LOG: warn
3637

3738
jobs:
39+
homeserver-restore-drill:
40+
name: Homeserver restore drill
41+
runs-on: ubuntu-latest
42+
timeout-minutes: 15
43+
steps:
44+
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
45+
46+
- name: Restore a real Synapse backup into isolated services
47+
working-directory: mesh
48+
env:
49+
MESH_RUN_RESTORE_INTEGRATION: "1"
50+
run: sh infra/homeserver/tests/restore-drill.integration.sh
51+
3852
soak:
3953
name: Long-duration soak
4054
runs-on: ubuntu-latest
@@ -43,7 +57,9 @@ jobs:
4357
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
4458

4559
- name: Install Rust toolchain
46-
uses: dtolnay/rust-toolchain@387aeee55b189f024a4f6d94890c5b18d73339cc # 1.92.0
60+
uses: dtolnay/rust-toolchain@387aeee55b189f024a4f6d94890c5b18d73339cc
61+
with:
62+
toolchain: 1.93.0
4763

4864
- name: Install system dependencies
4965
run: |
@@ -108,7 +124,9 @@ jobs:
108124
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
109125

110126
- name: Install Rust toolchain
111-
uses: dtolnay/rust-toolchain@387aeee55b189f024a4f6d94890c5b18d73339cc # 1.92.0
127+
uses: dtolnay/rust-toolchain@387aeee55b189f024a4f6d94890c5b18d73339cc
128+
with:
129+
toolchain: 1.93.0
112130

113131
- name: Install system dependencies
114132
run: |

.github/workflows/release-beta.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,10 @@ jobs:
3333
cache: npm
3434
cache-dependency-path: mesh/package-lock.json
3535

36-
- name: Install Rust 1.92 with Clippy
37-
uses: dtolnay/rust-toolchain@387aeee55b189f024a4f6d94890c5b18d73339cc # 1.92.0
36+
- name: Install Rust 1.93 with Clippy
37+
uses: dtolnay/rust-toolchain@387aeee55b189f024a4f6d94890c5b18d73339cc
3838
with:
39+
toolchain: 1.93.0
3940
components: clippy
4041

4142
- name: Install Tauri system dependencies
@@ -137,8 +138,10 @@ jobs:
137138
cache: npm
138139
cache-dependency-path: mesh/package-lock.json
139140

140-
- name: Install Rust 1.92
141-
uses: dtolnay/rust-toolchain@387aeee55b189f024a4f6d94890c5b18d73339cc # 1.92.0
141+
- name: Install Rust 1.93
142+
uses: dtolnay/rust-toolchain@387aeee55b189f024a4f6d94890c5b18d73339cc
143+
with:
144+
toolchain: 1.93.0
142145

143146
- name: Install frontend dependencies
144147
working-directory: mesh

.github/workflows/security.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ jobs:
1515
runs-on: ubuntu-latest
1616
steps:
1717
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
18-
- uses: dtolnay/rust-toolchain@387aeee55b189f024a4f6d94890c5b18d73339cc # 1.92.0
18+
- uses: dtolnay/rust-toolchain@387aeee55b189f024a4f6d94890c5b18d73339cc
19+
with:
20+
toolchain: 1.93.0
1921
- name: Install Tauri system dependencies
2022
run: |
2123
sudo apt-get update
@@ -41,7 +43,9 @@ jobs:
4143
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
4244
with:
4345
fetch-depth: 0
44-
- uses: dtolnay/rust-toolchain@387aeee55b189f024a4f6d94890c5b18d73339cc # 1.92.0
46+
- uses: dtolnay/rust-toolchain@387aeee55b189f024a4f6d94890c5b18d73339cc
47+
with:
48+
toolchain: 1.93.0
4549
- name: Verify dependency advisory boundaries
4650
working-directory: mesh/src-tauri
4751
shell: bash
@@ -93,7 +97,9 @@ jobs:
9397
runs-on: ubuntu-latest
9498
steps:
9599
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
96-
- uses: dtolnay/rust-toolchain@387aeee55b189f024a4f6d94890c5b18d73339cc # 1.92.0
100+
- uses: dtolnay/rust-toolchain@387aeee55b189f024a4f6d94890c5b18d73339cc
101+
with:
102+
toolchain: 1.93.0
97103
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
98104
with:
99105
node-version: 22

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ node_modules/
55
dist/
66
dist-ssr/
77
target/
8+
__pycache__/
9+
*.py[cod]
810

911
# Logs & temp output
1012
*.log

mesh/e2e/authenticated-shell.spec.ts

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,11 @@ test.afterEach(async ({ page }) => {
2121
expect(runtimeErrors.get(page) ?? [], 'authenticated shell emitted runtime errors').toEqual([])
2222
})
2323

24-
async function installAuthenticatedMatrixMock(page: Page): Promise<void> {
25-
await page.addInitScript(() => {
24+
async function installAuthenticatedMatrixMock(
25+
page: Page,
26+
currentDeepLinks: string[] | null = null,
27+
): Promise<void> {
28+
await page.addInitScript((deepLinks) => {
2629
const calls: IpcCall[] = []
2730
const callbacks = new Map<number, (...args: unknown[]) => void>()
2831
let nextCallbackId = 1
@@ -287,6 +290,8 @@ async function installAuthenticatedMatrixMock(page: Page): Promise<void> {
287290
case 'matrix_clear_composer_draft':
288291
case 'plugin:event|unlisten':
289292
return null
293+
case 'plugin:deep-link|get_current':
294+
return deepLinks
290295
case 'matrix_wait_for_room_update':
291296
// The real command long-polls the SDK room-update stream. Keeping
292297
// this promise pending models that boundary without a CPU-heavy loop.
@@ -343,11 +348,14 @@ async function installAuthenticatedMatrixMock(page: Page): Promise<void> {
343348
}).__TAURI_EVENT_PLUGIN_INTERNALS__ = {
344349
unregisterListener: () => {},
345350
}
346-
})
351+
}, currentDeepLinks)
347352
}
348353

349-
async function openAuthenticatedShell(page: Page): Promise<void> {
350-
await installAuthenticatedMatrixMock(page)
354+
async function openAuthenticatedShell(
355+
page: Page,
356+
currentDeepLinks: string[] | null = null,
357+
): Promise<void> {
358+
await installAuthenticatedMatrixMock(page, currentDeepLinks)
351359
await page.goto('/')
352360
await expect(
353361
page.getByRole('navigation', { name: 'Communities and direct messages' }),
@@ -387,6 +395,17 @@ test.describe('authenticated desktop shell', () => {
387395
await expect(page.getByText('Anonymous', { exact: true })).toHaveCount(0)
388396
})
389397

398+
test('routes a cold-start Mesh invitation into the prefilled join flow', async ({ page }) => {
399+
const invite =
400+
'mesh://join?v=3&kind=matrix&room=!invited:mesh.test&via=mesh.test&service=https%3A%2F%2Fmatrix.mesh.test'
401+
await openAuthenticatedShell(page, [invite])
402+
403+
const dialog = page.getByRole('dialog', { name: 'Join a community' })
404+
await expect(dialog).toBeVisible()
405+
await expect(dialog.getByLabel('Invite code or link')).toHaveValue(invite)
406+
await expect(dialog.getByRole('button', { name: 'Join Community' })).toBeEnabled()
407+
})
408+
390409
test('@a11y has no automated WCAG A/AA violations in the shell and settings', async ({ page }) => {
391410
await openAuthenticatedShell(page)
392411
await expectNoWcagViolations(page, 'Authenticated desktop shell')

mesh/e2e/dm-message-keyboard-actions.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,8 @@ async function installDmKeyboardActionsMock(page: Page): Promise<void> {
199199
case 'matrix_clear_composer_draft':
200200
case 'plugin:event|unlisten':
201201
return null
202+
case 'plugin:deep-link|get_current':
203+
return null
202204
case 'matrix_user_preferences':
203205
return null
204206
case 'matrix_update_user_preferences':

mesh/e2e/matrix-messaging.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,8 @@ async function installAuthenticatedMatrixMessagingMock(page: Page): Promise<void
293293
case 'matrix_clear_composer_draft':
294294
case 'plugin:event|unlisten':
295295
return null
296+
case 'plugin:deep-link|get_current':
297+
return null
296298
case 'matrix_user_preferences':
297299
return null
298300
case 'matrix_update_user_preferences':

mesh/e2e/message-keyboard-actions.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,8 @@ async function installKeyboardActionsMock(page: Page): Promise<void> {
200200
case 'matrix_clear_composer_draft':
201201
case 'plugin:event|unlisten':
202202
return null
203+
case 'plugin:deep-link|get_current':
204+
return null
203205
case 'matrix_wait_for_room_update':
204206
return new Promise(() => {})
205207
case 'plugin:event|listen':

0 commit comments

Comments
 (0)