-
Notifications
You must be signed in to change notification settings - Fork 2
Eject dependency on tgbot-cpp types through translation layer with raw pointers #36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
Copilot
wants to merge
8
commits into
master
Choose a base branch
from
copilot/create-dependency-ejection
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
Co-authored-by: Royna2544 <69458352+Royna2544@users.noreply.github.com>
…types Co-authored-by: Royna2544 <69458352+Royna2544@users.noreply.github.com>
Co-authored-by: Royna2544 <69458352+Royna2544@users.noreply.github.com>
Co-authored-by: Royna2544 <69458352+Royna2544@users.noreply.github.com>
Co-authored-by: Royna2544 <69458352+Royna2544@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Implement dependency ejection from tgbot-cpp
Eject dependency on tgbot-cpp types through translation layer
Dec 30, 2025
Owner
|
@copilot continue the work |
Co-authored-by: Royna2544 <69458352+Royna2544@users.noreply.github.com>
Contributor
Author
Updated all project types to use raw pointers instead of shared_ptr per project conventions (commit cfa8f74). All Continuing with Phase 4: updating TgBotApiImpl to use the translation layer. |
Co-authored-by: Royna2544 <69458352+Royna2544@users.noreply.github.com>
Copilot
AI
changed the title
Eject dependency on tgbot-cpp types through translation layer
Eject dependency on tgbot-cpp types through translation layer with raw pointers
Dec 30, 2025
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.
🚀 Pull Request
📋 Description
Introduces project-owned types (
tgbot_apinamespace) using raw pointers to decouple from tgbot-cpp library's type system. The TgBot API now exposes only project types while hiding tgbot-cpp implementation behind a bidirectional translation layer.Architecture Changes:
src/include/api/types/): Complete Telegram type definitions (User, Chat, Message, Media types, Reply/Input types) using raw pointers instead of shared_ptrtgbot_api::Message- single unified type with raw pointer membersTgBotTranslator): Bidirectional conversions betweenTgBot::andtgbot_api::types, allocating withnewinstead ofstd::make_shareddeletePointer Convention:
All project types use raw pointers (
T*) instead ofstd::shared_ptr<T>:Command Handler Migration:
Memory Management:
new, returns raw pointersTgBotApiImpl::commandHandlermanages message lifetime with explicitdeleteBenefits:
✅ Checklist
cmake+make/ninjaand verified the project builds.🧪 Test Plan
Completed Work:
newallocationRemaining Work:
See
DEPENDENCY_EJECTION.mdfor complete architecture documentation.📌 Related Issues or PRs
📝 Notes
Current State: Type infrastructure, translation layer, and TgBotApiImpl implementation complete. Uses raw pointers throughout for consistency with project conventions. Memory is managed explicitly with
new/deletein the translation layer and command handler.Memory Safety: Callers of translation functions are responsible for deleting returned pointers. TgBotApiImpl's
commandHandlermanages the lifecycle properly with early returns and cleanup after execution.TgBot::InlineQueryResult and EventBroadcaster: Intentionally kept as TgBot types - internal implementation details not exposed through public API.
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.