Skip to content

Correct MTProto envelope padding and respect declared incoming body l… #4

Correct MTProto envelope padding and respect declared incoming body l…

Correct MTProto envelope padding and respect declared incoming body l… #4

Workflow file for this run

name: MTProto connection regression tests
on:
workflow_dispatch:
push:
paths:
- 'Tests/MTConnection/**'
- 'submodules/MtProtoKit/Sources/**'
- '.github/workflows/mtproto-tests.yml'
permissions:
contents: read
jobs:
connection:
runs-on: macos-26
timeout-minutes: 10
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 20
- run: bash Tests/MTConnection/run.sh
- name: Reproduce failures on the previous release
run: |
mkdir -p "$RUNNER_TEMP/mt-baseline"
for file in MTTimer.m MTTcpConnectionBehaviour.m MTRequestMessageService.m MTTcpTransport.m MTProto.m; do
git show 3762285be10792d9e6be0e8d8dcdb4bead91b1a8:submodules/MtProtoKit/Sources/$file > "$RUNNER_TEMP/mt-baseline/$file"
done
for test in rearm manual-rearm disabled cancel-retry requests transport envelope parser; do
if MT_CONNECTION_SOURCE_ROOT="$RUNNER_TEMP/mt-baseline" bash Tests/MTConnection/run.sh "$test" > "$RUNNER_TEMP/mt-baseline/$test.log" 2>&1; then
echo "::error::Baseline unexpectedly passed $test"
exit 1
fi
cat "$RUNNER_TEMP/mt-baseline/$test.log"
case "$test" in
rearm|manual-rearm) expected='Timed out: callback/retry was lost' ;;
disabled) expected='Disabled transport requested a connection' ;;
cancel-retry) expected='A retry survived disabling reconnection' ;;
requests) expected='Dependency scans are not linear' ;;
transport) expected='Recovery with no socket did not reconnect' ;;
envelope) expected='Valid maximum padding rejected' ;;
parser) expected='Parser included padding beyond declared body' ;;
esac
grep -Fq "$expected" "$RUNNER_TEMP/mt-baseline/$test.log"
echo "Confirmed baseline failure: $test"
done