Skip to content

Conversation

@brizzinck
Copy link
Member

No description provided.

@brizzinck brizzinck self-assigned this Jul 30, 2025
@brizzinck brizzinck changed the title Uupdate YaTgStorage API, also add SessionStorage implementation Update YaTgStorage API, also add SessionStorage implementation Jul 30, 2025
@brizzinck brizzinck requested a review from Copilot July 30, 2025 20:15

This comment was marked as outdated.

@brizzinck brizzinck requested a review from Copilot July 30, 2025 20:41

This comment was marked as outdated.

@brizzinck brizzinck requested a review from Copilot July 30, 2025 20:44

This comment was marked as outdated.

@brizzinck brizzinck marked this pull request as ready for review July 30, 2025 21:11
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.

Avoid CGO and native libs

@brizzinck brizzinck requested a review from Copilot July 31, 2025 07:41
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 updates the YaTgStorage API to improve its design and adds a new SessionStorage implementation with encryption capabilities. The main changes focus on removing entity-specific state from the Storage constructor and making the API more flexible by requiring entity IDs to be passed with each operation.

  • Removed entityID and handler parameters from NewStorage constructor, making the API more flexible
  • Updated all storage methods to accept entityID as a parameter instead of using instance-level state
  • Added comprehensive SessionStorage implementation with AES encryption and multiple repository backends (GORM, in-memory)

Reviewed Changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
yatgstorage/yatgstorage.go Updates Storage API to accept entityID per operation, removes instance-level entity state, improves thread safety
yatgstorage/yatgstorage_test.go Updates test cases to match new API signature and adds entityID parameters
yatgstorage/session_storage.go Adds new SessionStorage implementation with AES encryption and repository pattern
yatgstorage/session_storage_test.go Comprehensive test suite for SessionStorage functionality
yatgclient/yatgclient.go Updates client code to pass required parameters to new Storage API
go.mod Adds dependencies for GORM and SQLite support
Comments suppressed due to low confidence (2)

go.mod:55

  • The golang.org/x/exp version '0.0.0-20250620022241-b7579e27df2b' appears to be from a future date (June 2025) which may not exist. Consider using a valid existing version or removing this specific version constraint.
	golang.org/x/exp v0.0.0-20250620022241-b7579e27df2b // indirect

yatgstorage/session_storage_test.go:18

  • The test uses a hardcoded string 'stolyarovtop' as encrypted auth key, but doesn't test with various data types or edge cases like empty data, very large data, or binary data that might contain null bytes.
	encryptedAuthKey = "stolyarovtop"

"github.com/YaCodeDev/GoYaCodeDevUtils/yaerrors"
"github.com/gotd/td/telegram"
"gorm.io/gorm"
"gorm.io/gorm/clause"

This comment was marked as abuse.

@YaCodesDevelopment YaCodesDevelopment merged commit 2107df2 into main Jul 31, 2025
1 check passed
@YaCodesDevelopment YaCodesDevelopment deleted the feature/telegram_session_storage branch July 31, 2025 08:19
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