feat: save group tag in DB on create#70
Conversation
|
Caution Review failedPull request was closed or merged during review WalkthroughAdds an Changes
Sequence Diagram(s)sequenceDiagram
actor User
participant Command as "updategroup\nHandler"
participant API as "Telegram API"
participant GroupMgmt as "GroupManagement"
participant Backend as "Backend API"
participant Logger as "TG Logger"
User->>Command: /updategroup <chatId>
Command->>API: getChat(chatId)
API-->>Command: chat details
Command->>GroupMgmt: update(chatId, requestedBy)
GroupMgmt->>API: getChat(chatId)
API-->>GroupMgmt: chat details
alt chat exists & has invite_link
GroupMgmt->>Backend: updateGroup mutation
Backend-->>GroupMgmt: success
GroupMgmt->>Logger: emit UPDATE event
Logger-->>Command: confirmation
Command-->>User: success reply
else error / validation fail
GroupMgmt->>Logger: emit UPDATE_FAIL event
Logger-->>Command: error message (may include invite link)
Command-->>User: error reply
end
Possibly related PRs
🚥 Pre-merge checks | ✅ 1 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/commands/management/groups.ts`:
- Line 12: Update the user-facing text: change the command's description string
(the description property in this command definition currently set to "Get the
audit log of a user") to an accurate description of this command's purpose, and
fix the grammar in the error message that currently reads "does not exists" to
"does not exist" (search for that exact phrase in this file and update the
corresponding user-facing reply/throw). Ensure both the description property and
the user-facing error string are corrected to the intended, grammatical copy.
In `@src/lib/group-management/index.ts`:
- Around line 68-70: The code calls errorBackend(chat, "CREATE", res[0] !==
chat.id) which treats an empty res array as a mismatch; change the logic to
detect emptiness first and only mark a fatal mismatch when res.length > 0 and
res[0] !== chat.id (e.g., compute mismatch = res.length > 0 && res[0] !==
chat.id) and pass that to errorBackend; apply the same fix to the other
occurrence around lines 99-101 so empty responses are not classified as fatal.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 2ad76c49-7290-4e29-aba3-ac8e0a792a00
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (7)
package.jsonsrc/commands/management/groups.tssrc/commands/management/index.tssrc/lib/group-management/index.tssrc/middlewares/bot-membership-handler.tssrc/modules/tg-logger/index.tssrc/modules/tg-logger/types.ts
No description provided.