-
Notifications
You must be signed in to change notification settings - Fork 302
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
Communication
: Allow recreation of a channel with same name after it's previous deletion
#10189
base: develop
Are you sure you want to change the base?
Communication
: Allow recreation of a channel with same name after it's previous deletion
#10189
Conversation
…duplicate create actions
WalkthroughThe pull request addresses an issue with channel recreation in the course conversations component. The modification focuses on the Changes
Assessment against linked issues
Possibly related PRs
Suggested labels
Suggested reviewers
✨ Finishing Touches
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🔭 Outside diff range comments (1)
src/main/webapp/app/overview/course-conversations/course-conversations.component.ts (1)
Line range hint
282-293
: Enhance error handling in channel creation.While the error is logged to Sentry, consider adding user feedback and specific error case handling:
- Display error messages to users
- Handle specific error cases (e.g., temporary name conflicts during recreation)
- Provide retry options for transient failures
performChannelAction(channelAction: ChannelAction) { if (this.createChannelFn) { this.createChannelFn(channelAction.channel) .pipe(takeUntil(this.ngUnsubscribe)) .subscribe({ complete: () => { this.prepareSidebarData(); }, error: (error) => { + // Log to Sentry captureException('Error creating channel:', error); + // Handle specific error cases + const errorMessage = this.getChannelCreationErrorMessage(error); + // Display user feedback (inject appropriate service) + this.notificationService.error(errorMessage); }, }); } } + private getChannelCreationErrorMessage(error: any): string { + if (error.status === 409) { + return 'Channel creation failed. Please try again in a few moments.'; + } + return 'Failed to create channel. Please try again.'; + }
🧹 Nitpick comments (1)
src/main/webapp/app/overview/course-conversations/course-conversations.component.ts (1)
263-265
: LGTM! Consider extracting the comparison function for better readability.The modification correctly allows channel recreation by excluding 'create' actions from the distinctness check. This aligns with the PR objective to enable recreation of channels with the same name.
Consider extracting the comparison function for better readability:
+ private isEquivalentChannelAction(prev: ChannelAction, curr: ChannelAction): boolean { + return curr.action !== 'create' && + prev.action === curr.action && + prev.channel.id === curr.channel.id && + prev.channel.name === curr.channel.name; + } this.channelActions$ .pipe( debounceTime(500), - distinctUntilChanged( - (prev, curr) => curr.action !== 'create' && prev.action === curr.action && prev.channel.id === curr.channel.id && prev.channel.name === curr.channel.name, - ), + distinctUntilChanged(this.isEquivalentChannelAction),
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/main/webapp/app/overview/course-conversations/course-conversations.component.ts
(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
src/main/webapp/app/overview/course-conversations/course-conversations.component.ts (1)
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: Codacy Static Code Analysis
- GitHub Check: client-tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested on TS4, works as expected. I didn't have to reload the page.
Checklist
General
Client
authorities
to all new routes and checked the course groups for displaying navigation elements (links, buttons).Motivation and Context
Currently it is not possible to recreate a channel with the same name than a previously deleted one without reloading the page. This PR makes this possible. Fixes #10135.
Description
I changed the distinctUntilChanged function in the channelActions$ event emitter to allow duplicate create actions
Steps for Testing
Prerequisites:
Testserver States
Note
These badges show the state of the test servers.
Green = Currently available, Red = Currently locked
Click on the badges to get to the test servers.
Review Progress
Performance Review
Code Review
Manual Tests
Exam Mode Test
Performance Tests
Test Coverage
Screenshots
Summary by CodeRabbit