Skip to content

Conversation

@brizzinck
Copy link
Member

No description provided.

@brizzinck brizzinck self-assigned this Jul 25, 2025
@brizzinck brizzinck requested a review from Copilot July 26, 2025 22:36

This comment was marked as outdated.

@brizzinck brizzinck requested a review from Copilot July 27, 2025 11:51

This comment was marked as outdated.

@brizzinck brizzinck requested a review from Copilot July 27, 2025 16:42
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment on lines +121 to +122
// 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.

Comment on lines +337 to +348
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.

Comment on lines +405 to +413
other.mu.RLock()

for k := range m.data {
if !other.Has(k) {
return false
}
}

m.mu.RUnlock()

This comment was marked as spam.

Comment on lines +468 to +479
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.

Comment on lines +500 to +516
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.

@brizzinck brizzinck changed the title Telegram storage with gotd in redis only: Bot State, Channel Access Hash, Channel Pts 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 Jul 27, 2025
@brizzinck brizzinck marked this pull request as ready for review July 27, 2025 16:48
Copy link
Member

@YaCodesDevelopment YaCodesDevelopment left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Have set" is not a valid form, replace it everywhere with something adequate

@YaCodesDevelopment YaCodesDevelopment merged commit b729e37 into main Jul 27, 2025
1 check passed
@YaCodesDevelopment YaCodesDevelopment deleted the feature/yatgstorage branch July 27, 2025 20:28
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.

3 participants