Skip to content

Delete attachment redirect to the error page#181

Closed
Rajat-Dabade wants to merge 3 commits into
mainfrom
attachment-delete-fix
Closed

Delete attachment redirect to the error page#181
Rajat-Dabade wants to merge 3 commits into
mainfrom
attachment-delete-fix

Conversation

@Rajat-Dabade

Copy link
Copy Markdown
Contributor

Summary

Deleting an attachment could succeed on the server while the UI still showed it, the confirm dialog stayed open, or the app crashed and sent users to the error page. This PR fixes client handling of attachment deletes and websocket tombstones.

The PR includes:

  • Await async onDelete and close the confirmation dialog after a successful delete.
  • Harden getUploadPercent / upload-progress updates when the attachment row is already removed from Redux.
  • Fix updateAttachments reducer (no premature return that skipped batch items, safer parentId for tombstones).
  • Route websocket batches by block type; include attachment tombstones whose hydrated type is wrong but the id is still a known attachment (selectBlocksForAttachmentSliceUpdate).
  • Optimistic removal in mutator.deleteBlock after HTTP success for attachment blocks.
  • hydrateBlock: unknown/empty type falls back to createBlock without assertFailure.
  • updateAllBoardsAndBlocks: pass all boards to updateBoards (not only deleted); align attachment/content filtering with the board page websocket handler.

Ticket Link

https://mattermost.atlassian.net/browse/MM-68059

@coderabbitai

coderabbitai Bot commented Mar 24, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: b6cbeec2-00ad-4e53-9c63-a0c96b671738

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch attachment-delete-fix

Comment @coderabbitai help to get the list of available commands and usage tips.

@Rajat-Dabade Rajat-Dabade self-assigned this Mar 24, 2026
@Rajat-Dabade Rajat-Dabade added 2: Dev Review Requires review by a core committer 3: QA Review Requires review by a QA tester labels Mar 24, 2026
@Rajat-Dabade Rajat-Dabade changed the title Fix the redirect loop on board Delete attachment redirect to the error page Mar 24, 2026
@Rajat-Dabade

Copy link
Copy Markdown
Contributor Author

Done as a part of this PR: #184

@Rajat-Dabade Rajat-Dabade deleted the attachment-delete-fix branch April 7, 2026 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2: Dev Review Requires review by a core committer 3: QA Review Requires review by a QA tester

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant