Update YaTgStorage API, also add SessionStorage implementation#8
Merged
YaCodesDevelopment merged 13 commits intomainfrom Jul 31, 2025
Merged
Update YaTgStorage API, also add SessionStorage implementation#8YaCodesDevelopment merged 13 commits intomainfrom
YaTgStorage API, also add SessionStorage implementation#8YaCodesDevelopment merged 13 commits intomainfrom
Conversation
YaTgStorage API, also add SessionStorage implementationYaTgStorage API, also add SessionStorage implementation
YaCodesDevelopment
requested changes
Jul 31, 2025
Member
YaCodesDevelopment
left a comment
There was a problem hiding this comment.
Avoid CGO and native libs
There was a problem hiding this comment.
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
entityIDandhandlerparameters fromNewStorageconstructor, making the API more flexible - Updated all storage methods to accept
entityIDas a parameter instead of using instance-level state - Added comprehensive
SessionStorageimplementation 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.
This comment was marked as abuse.
Sorry, something went wrong.
YaCodesDevelopment
approved these changes
Jul 31, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.