Skip to content

fix(client): handle joining a deleted channel gracefully#471

Merged
muke1908 merged 3 commits into
muke1908:masterfrom
Ahtisham992:fix/channel-deletion
Jul 21, 2026
Merged

fix(client): handle joining a deleted channel gracefully#471
muke1908 merged 3 commits into
muke1908:masterfrom
Ahtisham992:fix/channel-deletion

Conversation

@Ahtisham992

@Ahtisham992 Ahtisham992 commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Closes #404

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 improves the client-side UX around deleted channels by adding a “delete channel” action and by attempting to block joining channels that are no longer valid, showing a dedicated “Channel Deleted” view instead of a generic join failure.

Changes:

  • Extend the chat context API with deleteChannel() and wire it into the provider.
  • Add a pre-join “channel status” check and surface a “Channel Deleted” UI in the setup overlay.
  • Add a delete (trash) icon + header button to let users delete the current channel.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
client/src/types/index.ts Adds deleteChannel() to the shared chat context type.
client/src/context/ChatContext.tsx Adds status check before joining and implements deleteChannel() that calls the service delete API.
client/src/components/SetupOverlay/SetupOverlay.tsx Adds a deleted view state and specialized UI when join fails due to deletion.
client/src/components/common/icons.tsx Introduces TrashIcon for the new delete button.
client/src/components/ChatContainer/ChatHeader.tsx Adds a “Delete Chat” header action that calls deleteChannel().

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread client/src/context/ChatContext.tsx Outdated
Comment on lines +60 to +62
// Check for channel status before joining
const baseUrl = process.env.CHATE2EE_API_URL || 'http://localhost:3001';
const statusRes = await fetch(`${baseUrl}/chatHash/status/${hash}`);
Comment thread client/src/context/ChatContext.tsx Outdated
Comment on lines +63 to +67
if (statusRes.status === 404) {
throw new Error('CHANNEL_DELETED');
}
if (!statusRes.ok) {
throw new Error('Failed to verify channel status');
Comment on lines +91 to +96
<Button
className="btn--icon"
variant="danger"
onClick={handleDelete}
title="Delete Chat"
>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

Comment thread client/src/components/SetupOverlay/SetupOverlay.tsx
Comment thread client/src/components/ChatContainer/ChatHeader.tsx Outdated
Comment thread client/src/components/ChatContainer/ChatHeader.tsx Outdated
Comment thread client/src/context/ChatContext.tsx
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@sonarqubecloud

Copy link
Copy Markdown

@muke1908
muke1908 merged commit c5bddde into muke1908:master Jul 21, 2026
1 of 3 checks passed
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.

Able to join chat after deletion

3 participants