Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
986a737
feat: extend signalStorage type to include loadSignedPreKey method
jlucaso1 Nov 16, 2025
5a719a2
feat: group support
jlucaso1 Nov 16, 2025
b879c3a
refactor: replace libsignal dependency with whatsapp-rust-bridge func…
jlucaso1 Nov 16, 2025
1f2128f
fix: import Long type for improved type handling
jlucaso1 Nov 16, 2025
2c774f5
chore: update whatsapp-rust-bridge to version 0.4.0-alpha.2
jlucaso1 Nov 16, 2025
224b2a8
fix: update whatsapp-rust-bridge to version 0.4.0-alpha.3 (migration …
jlucaso1 Nov 20, 2025
65725a6
fix: update whatsapp-rust-bridge to version 0.4.0-alpha.4
jlucaso1 Nov 21, 2025
a0cb521
chore: bump whatsapp-rust-bridge
jlucaso1 Nov 24, 2025
7005256
fix: simplify address creation in group message handling
jlucaso1 Nov 25, 2025
6d51078
chore: update whatsapp-rust-bridge to version 0.4.1
jlucaso1 Nov 25, 2025
b66cd67
fix: improve error handling in message decryption
jlucaso1 Nov 26, 2025
1124e4c
chore: update whatsapp-rust-bridge to version 0.4.4
jlucaso1 Dec 1, 2025
4d3a0d6
chore: update whatsapp-rust-bridge to version 0.4.5
jlucaso1 Dec 4, 2025
03a67e5
chore: update whatsapp-rust-bridge to version 0.4.6 and set logger in…
jlucaso1 Dec 4, 2025
8e7e202
chore: update whatsapp-rust-bridge to version 0.4.7
jlucaso1 Dec 5, 2025
113a85b
chore: update whatsapp-rust-bridge to version 0.4.8
jlucaso1 Dec 14, 2025
0f964dd
fix: force 99 deviceId to be hosted device
jlucaso1 Dec 15, 2025
89e3f75
fix: update whatsapp-rust-bridge to version 0.5.0-alpha.1
jlucaso1 Jan 8, 2026
bbdeaa6
perf: binary serialization works better with lru-cache
jlucaso1 Jan 18, 2026
3a2b93c
Merge branch 'master' of https://github.com/WhiskeySockets/Baileys in…
jlucaso1 Feb 6, 2026
8614d17
Merge branch 'master' into feat-libsignal-wasm
jlucaso1 Jun 16, 2026
ed0802c
chore: merge develop into feat-libsignal-wasm
jlucaso1 Aug 4, 2026
6f1e6c7
fix: scope device domainType per device, guard SKDM input
jlucaso1 Aug 4, 2026
3c89612
fix(signal): honor signature results and keep pre-WASM sessions readable
jlucaso1 Aug 4, 2026
1f34024
fix(signal): never revive a closed legacy session, keep live LID sess…
jlucaso1 Aug 4, 2026
a28a7db
feat(signal): convert pre-WASM sessions through the core's typed model
jlucaso1 Aug 5, 2026
45922f6
fix(bridge): key identity records by the full address
jlucaso1 Aug 5, 2026
cb420b9
fix(bridge): delete the pre-key a prekey message consumed
jlucaso1 Aug 5, 2026
728f8b9
feat(bridge): run signal operations over a snapshot
jlucaso1 Aug 5, 2026
bdcb9e7
feat(signal): move the session path onto the snapshot API
jlucaso1 Aug 5, 2026
a7e26ab
fix(signal): address device 99 and live LID sessions during migration
jlucaso1 Aug 5, 2026
1a68dec
fix(bridge): review fixes for the snapshot path
jlucaso1 Aug 5, 2026
7a1274e
ci: build the bridge from source when a change touches it
jlucaso1 Aug 5, 2026
af7ccd9
style(bridge): drop redundant to_string in format args
jlucaso1 Aug 5, 2026
1a8a4e7
fix(signal): lock the identity row with the session, and pick one dev…
jlucaso1 Aug 5, 2026
3189994
ci: force the bridge build in the job that exists to compile it
jlucaso1 Aug 5, 2026
28fe323
fix(signal): prefer the open row when a device has two address shapes
jlucaso1 Aug 5, 2026
f5a807b
perf(bridge): report the peer identity only when it changes
jlucaso1 Aug 5, 2026
251fceb
test(signal): generate the one-time pre-keys the fixtures use
jlucaso1 Aug 5, 2026
fa510ed
fix(bridge): treat an absent JS property as absent
jlucaso1 Aug 5, 2026
89dff66
ci: read the changed files without a pipe
jlucaso1 Aug 5, 2026
d82873f
test(bridge): unit-test the Rust side
jlucaso1 Aug 5, 2026
632367a
test(bridge): skip the Rust tests when wasm-pack is absent
jlucaso1 Aug 5, 2026
bfb489e
test(bridge): detect wasm-pack from Node instead of the shell
jlucaso1 Aug 5, 2026
4a087cf
Merge branch 'develop' into feat-libsignal-wasm
jlucaso1 Aug 5, 2026
20e69e8
fix: review follow-ups after the develop merge
jlucaso1 Aug 5, 2026
bd9e2c5
fix(signal): build a sender key without seeding an empty record
jlucaso1 Aug 5, 2026
7c268da
chore(bridge): pin the core that persists skipped-key seeds
jlucaso1 Aug 5, 2026
e673f3a
feat(signal): store sessions in the shape a pre-WASM release reads
jlucaso1 Aug 5, 2026
3aaa17f
test(signal): say what the assertions actually check
jlucaso1 Aug 5, 2026
ffb0802
fix(signal): rebuild a session the bridge cannot read
jlucaso1 Aug 5, 2026
d5faeb3
test(signal): prove the rebuilt session is persisted
jlucaso1 Aug 5, 2026
3606e32
feat(bridge): project a sender-key record into the v1 shape
jlucaso1 Aug 5, 2026
f5031d7
feat(signal): store group sender keys in the pre-WASM shape
jlucaso1 Aug 5, 2026
1e8a8f2
fix(bridge): keep the empty private signing key in the projected record
jlucaso1 Aug 5, 2026
1797917
build(bridge): add a profiling build that keeps symbols
jlucaso1 Aug 5, 2026
3d9eca8
build(bridge): fail the profiling build with an actionable message
jlucaso1 Aug 5, 2026
233d021
fix(bridge): read legacy sender keys whose buffers are base64 text
jlucaso1 Aug 5, 2026
d35efeb
fix(bridge): write legacy sender-key states oldest first
jlucaso1 Aug 5, 2026
fdeb5c3
fix(bridge): resolve wasm-bindgen from PATH in profiling builds
jlucaso1 Aug 5, 2026
734c0f6
test(bridge): stop forcing a GC between benchmark iterations
jlucaso1 Aug 5, 2026
a1deea8
fix(bridge): waive the core's counter lease
jlucaso1 Aug 5, 2026
c06ab3f
fix(bridge): waive the counter lease on the store paths too
jlucaso1 Aug 5, 2026
e8bd646
perf(bridge): keep the sender-key derivation the record cannot keep
jlucaso1 Aug 6, 2026
1d9eb8c
refactor(bridge): drop the legacy session JSON fallback
jlucaso1 Aug 6, 2026
ddb7f26
refactor(bridge): drop the callback-based session API
jlucaso1 Aug 6, 2026
4abc400
test: shrink the legacy fixture and record the wire parity vectors
jlucaso1 Aug 6, 2026
ecbdaf8
fix(bridge): make the recorded wire vectors typecheck and round-trip
jlucaso1 Aug 6, 2026
01c56a0
test(bridge): reject a malformed Buffer in a recorded vector
jlucaso1 Aug 6, 2026
be2f94e
chore(bridge): drop five unused dependencies
jlucaso1 Aug 6, 2026
2a904a2
fix(signal): read a pre-v1 legacy session record
jlucaso1 Aug 6, 2026
182ce3a
fix(signal): satisfy prettier, and drop the libsignal-node mention
jlucaso1 Aug 6, 2026
01a8f56
test(bridge): handle the Result from add_sender_key_state
jlucaso1 Aug 6, 2026
b302631
test(bridge): port the signal bench to the snapshot calls
jlucaso1 Aug 6, 2026
a6a0ca7
fix(bridge): clear the bench session when the peer's identity is repl…
jlucaso1 Aug 6, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
162 changes: 162 additions & 0 deletions .github/actions/setup-workspace/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
name: Setup workspace
description: >-
Installs workspace dependencies, building whatsapp-rust-bridge from source
when the change touches it.

# `pnpm install` runs a postinstall hook that copies the last PUBLISHED bridge
# tarball into the workspace, so a change to the Rust crate or its TS wrapper is
# invisible to every other package until it is released. A PR that adds an
# export therefore fails here with "does not provide an export named ...",
# which says nothing about the code under review.
#
# When the change touches the bridge, skip that download and compile the crate
# instead, so the suite runs against the source in the PR. Otherwise keep the
# prebuilt: it is the same artifact consumers get, and it costs seconds.

inputs:
force-bridge-build:
description: >-
Compile the bridge regardless of what the change touches. Set by jobs that
cannot run without it, such as the bridge's own build.
required: false
default: 'false'
node-version:
description: Node version to install
required: false
default: 20.x
pnpm-version:
description: pnpm version to install
required: false
default: 10.28.2

outputs:
bridge-built:
description: Whether the bridge was compiled from source
value: ${{ steps.detect.outputs.changed }}

runs:
using: composite

steps:
- name: Detect bridge changes
id: detect
shell: bash
env:
FORCE_BUILD: ${{ inputs.force-bridge-build }}
GH_TOKEN: ${{ github.token }}
EVENT_NAME: ${{ github.event_name }}
PR_NUMBER: ${{ github.event.pull_request.number }}
run: |
set -euo pipefail

# Some jobs cannot run against a prebuilt at all.
if [ "$FORCE_BUILD" = "true" ]; then
echo "changed=true" >> "$GITHUB_OUTPUT"
echo "Bridge build forced by the caller."
exit 0
fi

# On a push to a protected branch there is no diff to consult and the
# published bridge may already be behind, so always build.
if [ "$EVENT_NAME" != "pull_request" ] && [ "$EVENT_NAME" != "pull_request_target" ]; then
echo "changed=true" >> "$GITHUB_OUTPUT"
echo "Not a pull request; building the bridge from source."
exit 0
fi

# Ask the API rather than diffing, which would need the full history.
if ! files="$(gh api --paginate \
"repos/${GITHUB_REPOSITORY}/pulls/${PR_NUMBER}/files" \
--jq '.[].filename')"; then
echo "changed=true" >> "$GITHUB_OUTPUT"
echo "::warning::Could not read the changed files; building the bridge from source."
exit 0
fi

# A here-string, not a pipe: grep -q exits at the first match, and a
# writer still filling the pipe would take SIGPIPE, which under pipefail
# fails the condition and quietly selects the prebuilt on exactly the
# large pull requests that most need the source build.
if grep -qE '^packages/whatsapp-rust-bridge/' <<< "$files"; then
echo "changed=true" >> "$GITHUB_OUTPUT"
echo "Bridge touched; building it from source."
else
echo "changed=false" >> "$GITHUB_OUTPUT"
echo "Bridge untouched; using the published prebuilt."
fi

- uses: pnpm/action-setup@v4
with:
version: ${{ inputs.pnpm-version }}

- uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node-version }}
cache: 'pnpm'

- name: Install Rust toolchain (pinned via rust-toolchain.toml)
if: steps.detect.outputs.changed == 'true'
shell: bash
working-directory: packages/whatsapp-rust-bridge
run: rustup show

- name: Install wasm-pack
if: steps.detect.outputs.changed == 'true'
uses: taiki-e/install-action@v2
with:
tool: wasm-pack

# Ubuntu's Binaryen is too old for the wasm-opt flags scripts/build-wasm.mjs
# passes. Keep this pinned pair in step with .github/workflows/bridge-build.yml.
- name: Cache Binaryen
if: steps.detect.outputs.changed == 'true'
id: cache-binaryen
uses: actions/cache@v4
with:
path: /tmp/binaryen-version_129
key: binaryen-129-x86_64-linux

- name: Download & verify Binaryen (wasm-opt)
if: steps.detect.outputs.changed == 'true' && steps.cache-binaryen.outputs.cache-hit != 'true'
shell: bash
env:
BINARYEN_VERSION: '129'
BINARYEN_SHA256: 50b9fa62b9abea752da92ec57e0c555fee578760cd237c40107957715d2976ba
run: |
set -euo pipefail
tarball="binaryen-version_${BINARYEN_VERSION}-x86_64-linux.tar.gz"
curl -fsSL "https://github.com/WebAssembly/binaryen/releases/download/version_${BINARYEN_VERSION}/${tarball}" -o "${tarball}"
echo "${BINARYEN_SHA256} ${tarball}" | sha256sum -c -
tar -xzf "${tarball}" -C /tmp
rm -f "${tarball}"

- name: Add Binaryen to PATH
if: steps.detect.outputs.changed == 'true'
shell: bash
run: echo "/tmp/binaryen-version_129/bin" >> "$GITHUB_PATH"

- name: Cache cargo registry + target
if: steps.detect.outputs.changed == 'true'
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
packages/whatsapp-rust-bridge/target
key: ${{ runner.os }}-cargo-${{ hashFiles('packages/whatsapp-rust-bridge/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-

- name: Skip the prebuilt download
if: steps.detect.outputs.changed == 'true'
shell: bash
run: echo "WHATSAPP_RUST_BRIDGE_SKIP_PREBUILT=1" >> "$GITHUB_ENV"

- name: Install dependencies
shell: bash
run: pnpm install --frozen-lockfile

- name: Build the bridge from source
if: steps.detect.outputs.changed == 'true'
shell: bash
run: pnpm --filter whatsapp-rust-bridge build
80 changes: 12 additions & 68 deletions .github/workflows/bridge-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,28 +19,25 @@ on:
- 'package.json'
- 'pnpm-workspace.yaml'
- '.github/workflows/bridge-build.yml'
- '.github/actions/setup-workspace/**'
pull_request:
paths:
- 'packages/whatsapp-rust-bridge/**'
- 'pnpm-lock.yaml'
- 'package.json'
- 'pnpm-workspace.yaml'
- '.github/workflows/bridge-build.yml'
- '.github/actions/setup-workspace/**'

permissions:
contents: read
pull-requests: read

jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 25

env:
BINARYEN_VERSION: "129"
# SHA-256 of the official binaryen-version_<N>-x86_64-linux.tar.gz release asset.
# Bump together with BINARYEN_VERSION; verified before extraction (supply-chain guard).
BINARYEN_SHA256: 50b9fa62b9abea752da92ec57e0c555fee578760cd237c40107957715d2976ba

defaults:
run:
working-directory: packages/whatsapp-rust-bridge
Expand All @@ -50,76 +47,23 @@ jobs:
with:
persist-credentials: false

- uses: pnpm/action-setup@v4
with:
version: 10.28.2

- uses: actions/setup-node@v4
with:
node-version: 20.x
cache: 'pnpm'

- name: Install Rust toolchain (pinned via rust-toolchain.toml)
run: rustup show

- name: Install wasm-pack
uses: taiki-e/install-action@v2
with:
tool: wasm-pack

# Ubuntu's Binaryen is too old for `--gufa-optimizing` and the other flags
# scripts/build-wasm.mjs passes to wasm-opt. wasm-pack ships no compatible
# wasm-opt and taiki-e/install-action doesn't package binaryen, so fetch a
# pinned upstream release — cached across runs, checksum-verified on a miss.
- name: Cache Binaryen
id: cache-binaryen
uses: actions/cache@v4
# Compiles the crate and installs the workspace against it.
- name: Setup workspace
uses: ./.github/actions/setup-workspace
Comment thread
cubic-dev-ai[bot] marked this conversation as resolved.
Comment thread
cubic-dev-ai[bot] marked this conversation as resolved.
with:
path: /tmp/binaryen-version_${{ env.BINARYEN_VERSION }}
key: binaryen-${{ env.BINARYEN_VERSION }}-x86_64-linux

- name: Download & verify Binaryen (wasm-opt)
if: steps.cache-binaryen.outputs.cache-hit != 'true'
run: |
tarball="binaryen-version_${BINARYEN_VERSION}-x86_64-linux.tar.gz"
curl -fsSL "https://github.com/WebAssembly/binaryen/releases/download/version_${BINARYEN_VERSION}/${tarball}" -o "${tarball}"
echo "${BINARYEN_SHA256} ${tarball}" | sha256sum -c -
tar -xzf "${tarball}" -C /tmp
rm -f "${tarball}"

- name: Add Binaryen to PATH
run: echo "/tmp/binaryen-version_${BINARYEN_VERSION}/bin" >> "$GITHUB_PATH"

- name: Cache cargo registry + target
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
packages/whatsapp-rust-bridge/target
key: ${{ runner.os }}-cargo-${{ hashFiles('packages/whatsapp-rust-bridge/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
# This job exists to compile the crate, so it must never fall back to
# the prebuilt: a lockfile-only PR still triggers it and would then
# reach `pnpm build` with no wasm-pack installed.
force-bridge-build: 'true'

- name: Check Rust formatting
run: cargo fmt --all -- --check

- name: Lint Rust
run: cargo clippy --target wasm32-unknown-unknown --all-features -- -D warnings

- name: Skip postinstall download
working-directory: ${{ github.workspace }}
run: echo "WHATSAPP_RUST_BRIDGE_SKIP_PREBUILT=1" >> "$GITHUB_ENV"

- name: Install workspace dependencies
working-directory: ${{ github.workspace }}
run: pnpm install --frozen-lockfile

- name: Build bridge from source
run: pnpm build

- name: Run bridge typecheck and Jest tests
run: pnpm test:typecheck && pnpm test:jest
- name: Run bridge typecheck, Rust unit tests and Jest tests
run: pnpm test:typecheck && pnpm test:rust && pnpm test:jest

- name: Test installed package, ESM/CommonJS, and WASM selection
run: pnpm test:package
Expand Down
19 changes: 8 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,22 @@ on:
- master
pull_request:

permissions:
contents: read
pull-requests: read

jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 10
timeout-minutes: 25

steps:
- uses: actions/checkout@v4
Comment thread
coderabbitai[bot] marked this conversation as resolved.

- uses: pnpm/action-setup@v4
with:
version: 10.28.2

- uses: actions/setup-node@v4
with:
node-version: 20.x
cache: 'pnpm'
persist-credentials: false

- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Setup workspace
uses: ./.github/actions/setup-workspace

- name: Build project
run: pnpm build
19 changes: 7 additions & 12 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,22 @@ on:
- master
pull_request:

permissions:
contents: read
pull-requests: read

jobs:
check-lint:
runs-on: ubuntu-latest
timeout-minutes: 10
timeout-minutes: 25

steps:
- uses: actions/checkout@v4
with:
persist-credentials: false

- uses: pnpm/action-setup@v4
with:
version: 10.28.2

- uses: actions/setup-node@v4
with:
node-version: 20.x
cache: 'pnpm'

- name: Install packages
run: pnpm install --frozen-lockfile
- name: Setup workspace
uses: ./.github/actions/setup-workspace

- name: Check linting
run: pnpm lint
19 changes: 7 additions & 12 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,23 @@ on:
- master
pull_request:

permissions:
contents: read
pull-requests: read

jobs:
run-tests:
runs-on: ubuntu-latest
timeout-minutes: 10
timeout-minutes: 25

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
persist-credentials: false

- uses: pnpm/action-setup@v4
with:
version: 10.28.2

- uses: actions/setup-node@v4
with:
node-version: 20.x
cache: 'pnpm'

- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Setup workspace
uses: ./.github/actions/setup-workspace

- name: Run tests
run: pnpm test
Loading