Telegram storage with gotd in redis only: Bot State, Channel Access Hash, Channel Pts, User Access Hash. Telegram Client Create with gotd: SOCKS5, MTProto, Background Connect, Bot Authorization, Run Updates Manager#7
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR implements a Redis-backed Telegram storage solution using gotd for managing bot state, channel access hashes, and channel pts. The implementation provides a comprehensive persistence layer for Telegram updates and state management.
- Adds a thread-safe set implementation (
yathreadsafeset) with concurrent operations support - Implements Redis-based Telegram storage (
yatgstorage) for bot state, channel pts, and access hashes - Provides Telegram client utilities (
yatgclient) with proxy support and background connection handling
Reviewed Changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| yathreadsafeset/yathreadsafeset.go | Thread-safe generic set implementation with mutex-protected operations |
| yathreadsafeset/yathreadsafeset_test.go | Comprehensive test suite for thread-safe set operations |
| yathreadsafeset/utils.go | Safety check utility for set initialization |
| yatgstorage/yatgstorage.go | Redis-backed storage for Telegram bot state and access hashes |
| yatgstorage/yatgstorage_test.go | Tests for storage operations and workflow validation |
| yatgstorage/errors.go | Error definitions for storage operations |
| yatgclient/yatgclient.go | Telegram client wrapper with proxy support |
| yatgclient/yatgclient_test.go | Tests for proxy parsing and client functionality |
| go.mod | Dependency updates for gotd and related packages |
| .golangci.yml | Added golines formatter |
| // DEADLOCK: During iteration, it is forbidden to modify the set (add or remove values), | ||
| // failing to do so will result in a deadlock. |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| other.mu.RLock() | ||
|
|
||
| intersection := NewThreadSafeSet[K]() | ||
|
|
||
| for k := range m.data { | ||
| if other.Has(k) { | ||
| intersection.Set(k) | ||
| } | ||
| } | ||
|
|
||
| m.mu.RUnlock() | ||
| other.mu.RUnlock() |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| other.mu.RLock() | ||
|
|
||
| for k := range m.data { | ||
| if !other.Has(k) { | ||
| return false | ||
| } | ||
| } | ||
|
|
||
| m.mu.RUnlock() |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| m.mu.RLock() | ||
| other.mu.RLock() | ||
|
|
||
| for k := range m.data { | ||
| if !other.Has(k) { | ||
| result.Set(k) | ||
| } | ||
| } | ||
|
|
||
| m.mu.RUnlock() | ||
| other.mu.RUnlock() | ||
|
|
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| other.mu.RLock() | ||
|
|
||
| for k := range m.data { | ||
| if !other.Has(k) { | ||
| result.Set(k) | ||
| } | ||
| } | ||
|
|
||
| for k := range other.data { | ||
| if !m.Has(k) { | ||
| result.Set(k) | ||
| } | ||
| } | ||
|
|
||
| m.mu.RUnlock() | ||
| other.mu.RUnlock() | ||
|
|
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
gotd in redis only: Bot State, Channel Access Hash, Channel Ptsgotd in redis only: Bot State, Channel Access Hash, Channel Pts, User Access Hash. Telegram Client Create with gotd: SOCKS5, MTProto, Background Connect, Bot Authorization, Run Updates Manager
YaCodesDevelopment
left a comment
There was a problem hiding this comment.
"Have set" is not a valid form, replace it everywhere with something adequate
No description provided.