Skip to content

fix: stabilize auth bootstrap and recovery - #17

Merged
dapi merged 2 commits into
mainfrom
fix/auth-bootstrap-recovery
Mar 12, 2026
Merged

fix: stabilize auth bootstrap and recovery#17
dapi merged 2 commits into
mainfrom
fix/auth-bootstrap-recovery

Conversation

@dapi

@dapi dapi commented Mar 12, 2026

Copy link
Copy Markdown
Owner

Summary

  • make auth/status/logout use auth-only clients without mtcute updates where possible
  • prevent \ from failing during synchronous dialog bootstrap
  • recover from \ during auth/bootstrap by recreating the MTProto client and retrying once
  • retry short dialog-bootstrap waits (\ / ) once during auth seeding
  • add coverage for auth bootstrap options and recovery paths

Verification

  • \

@dapi/tgcli@2.3.0 test
vitest run

RUN v4.0.18 /Users/danil/code/tgcli

✓ tests/store-lock.test.js (1 test) 3ms
✓ tests/services.test.js (3 tests) 4ms
✓ tests/telegram-client-auth.test.js (2 tests) 3ms
✓ tests/auth-recovery.test.js (3 tests) 3ms
✓ tests/send-messages.test.js (36 tests) 16ms
✓ tests/folders.test.js (74 tests) 13ms

Test Files 6 passed (6)
Tests 119 passed (119)
Start at 16:27:40
Duration 383ms (transform 325ms, setup 0ms, import 729ms, tests 43ms, environment 0ms)

  • {
    "authenticated": true,
    "configured": true,
    "phoneNumber": "+79033891228",
    "username": "pismenny",
    "ftsEnabled": true,
    "archiveReady": true,
    "archiveError": null
    }
  • \Existing session is valid.
    {
    "authenticated": true,
    "dialogs": null,
    "archiveReady": false,
    "archiveError": "Skipped dialog bootstrap because auth is running with a wall-clock timeout. Re-run without --timeout to seed dialogs."
    }
  • \Existing session is valid.
    Rate limited while seeding dialogs. Waiting 13s and retrying once...
    {
    "authenticated": true,
    "dialogs": 2155,
    "archiveReady": true,
    "archiveError": null
    }

Notes

  • when auth is run with a wall-clock timeout, login still succeeds, but dialog bootstrap is skipped intentionally and reported via \
  • short bootstrap waits are retried once automatically; long waits still surface as archive/bootstrap errors instead of hanging forever

@dapi
dapi merged commit dcfb66e into main Mar 12, 2026
1 check passed
@dapi
dapi deleted the fix/auth-bootstrap-recovery branch March 12, 2026 13:44
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