Skip to content

Latest commit

 

History

History
82 lines (70 loc) · 2.73 KB

File metadata and controls

82 lines (70 loc) · 2.73 KB

TDLib + Spring Boot POC Plan

Current Status

  • Date: 2026-02-11
  • Project: tdlib-poc
  • Group: io.ndmik
  • Scope target: login + getMe + sendTextMessage

Progress Board

Phase 0 — Scope

  • Lock POC goal: login + getMe + sendTextMessage
  • Decide first runtime target (macOS/Linux)
  • Prepare Telegram test account/chat
  • Confirm success criteria for sign-off

Phase 1 — TDLib Native Artifacts

  • Build TDLib in local build workspace (completed)
  • Verify native library exists:
    • Source: <tdlib-build>/build/libtdjson.1.8.61.dylib
    • Project copy: native/libtdjson.1.8.61.dylib
    • Symlink for runtime loading: native/libtdjson.dylib
  • Verify header exists:
    • <tdlib-build>/td/telegram/td_json_client.h
  • Copy native library into project-local native/ folder
  • Record TDLib commit hash used for build:
    • 6d509061574d684117f74133056aa43df89022fc (short: 6d5090615)

Phase 2 — Spring Boot Skeleton

  • Initialize Spring Boot project skeleton
  • Set group = 'io.ndmik'
  • Set app name tdlib-poc
  • Add main application class
  • Add context-load test
  • Add JNA dependency
  • Add typed config properties for TDLib settings

Phase 3 — TDLib Bridge (JNA)

  • Create JNA interface for td_json_client_* methods
  • Add request/response JSON mapper (Jackson)
  • Implement TdClient wrapper (send, receive, close)
  • Add startup/shutdown lifecycle hooks

Phase 4 — Authorization Flow

  • Implement TDLib init (setTdlibParameters)
  • Handle auth states (WaitTdlibParameters, WaitPhoneNumber, WaitCode, Ready)
  • Add phone number submission flow
  • Add auth code submission flow
  • Persist TDLib DB in project directory

Phase 5 — Minimal Features

  • Implement getMe
  • Implement sendMessage (text)
  • Expose minimal API or CLI commands for POC actions

Phase 6 — Observability & Safety

  • Add structured logs for update handling
  • Mask sensitive values in logs
  • Add receive loop timeout/retry behavior
  • Ensure graceful client shutdown

Phase 7 — Testing

  • Unit: native load test
  • Unit: JSON mapping test
  • Unit: auth state machine transition tests
  • Integration smoke test with env vars:
    • TD_API_ID
    • TD_API_HASH
    • TD_PHONE
  • Restart app and confirm session reuse from TDLib DB

Phase 8 — Runbook

  • Document setup/run flow in README
  • Add scripts (run-local, run-with-native-lib, smoke-test)
  • Add troubleshooting notes
  • Final sign-off checklist

Next Actions (Suggested Order)

  1. Run CHAT_ID=<id> ./final-signoff.sh.
  2. Confirm restart and TDLib session reuse.
  3. Validate final sign-off checklist.
  4. Commit/release preparation.