Skip to content

M1-E: Matrix sign-in and E2EE in the browser - #13

Open
hsmith-dev wants to merge 1 commit into
feat/read-receiptsfrom
feat/web-matrix
Open

hsmith-dev wants to merge 1 commit into
feat/read-receiptsfrom
feat/web-matrix

Conversation

@hsmith-dev

Copy link
Copy Markdown
Owner

Stacked on #12.

The web app (apps/chatcraft-web) now signs in to Matrix homeservers, with end-to-end encryption running in the page.

  • chatcraft-matrix builds for wasm32: target-specific deps (IndexedDB store on the web, SQLite natively), rt.rs for spawn/sleep, SecretStore::Browser (localStorage), and filesystem cleanup skipped in the browser.
  • Web shell: same sign-in screen as the desktop app. The account is remembered and resumes without a password. ?demo opens the demo workspace; #homeserver=…&user=… prefills the form (never a password).
  • Download size: a new web Cargo profile (opt-level z, fat LTO, stripped) brings the WebAssembly from 36 MB / 7.0 MB Brotli to 16 MB / 4.2 MB Brotli. wasm-opt is off because it saved nothing after compression.
  • cargo xtask wasm now checks chatcraft-matrix.
  • Docs: docs/matrix.md › In the browser (including the localStorage / CSP note), gaps 0.8, README, ROADMAP.

Testing

  • cargo xtask ci: all 7 steps pass.
  • cargo test -p chatcraft-matrix against local Synapse: 17 unit tests and 10 integration tests pass.
  • Manual check in headless Chrome against Synapse: demo renders; sign-in works; a wrong password shows an error; an encrypted DM sent from the CLI arrives; after a reload the session resumes and decrypts. There is no automated browser test yet; that gap is still listed.

🤖 Generated with Claude Code

…he browser

- chatcraft-matrix builds for wasm32: IndexedDB device store, localStorage
  secrets, a small runtime shim (spawn/sleep) for native and browser.
- chatcraft-web opens the sign-in shell; the account is remembered and resumes
  without a password. `?demo` opens the demo workspace and
  `#homeserver=…&user=…` prefills the form.
- `web` Cargo profile (opt-level z, fat LTO, stripped): 4.2 MB Brotli, down
  from 7 MB. wasm-opt is off; it saved nothing after compression.
- xtask wasm checks chatcraft-matrix.

Checked in headless Chrome against Synapse: sign-in, wrong password, an
encrypted DM from the CLI, and decryption after a reload.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant