-
Notifications
You must be signed in to change notification settings - Fork 13.1k
fix: Importing of Slack files #38291
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
base: develop
Are you sure you want to change the base?
Conversation
|
|
Looks like this PR is not ready to merge, because of the following issues:
Please fix the issues and try again If you have any trouble, please check the PR guidelines |
WalkthroughsetImportFileRocketChatAttachment in Messages.ts now performs two sequential database updates: first initializes Changes
Sequence Diagram(s)(omitted — change involves only application and database interactions) Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Warning Review ran into problems🔥 ProblemsErrors were encountered while retrieving linked issues. Errors (1)
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@packages/models/src/models/Messages.ts`:
- Around line 739-751: The first updateMany currently uses { ...query,
attachments: undefined } which won't match documents where attachments is null;
change that filter to explicitly match missing or null attachments, e.g. replace
the first argument of updateMany (the { ...query, attachments: undefined }
object) with { ...query, $or: [ { attachments: { $exists: false } }, {
attachments: null } ] } so those docs get reset to [] before the subsequent
updateMany that $addToSet the attachment.
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.
No issues found across 1 file
acfab24 to
d6d24e2
Compare
Proposed changes (including videos or screenshots)
Fix
setImportFileRocketChatAttachment, by first setting "attachements" to[]when it isundefinedbefore trying to add attachments.Issue(s)
#37058 (comment)
Steps to test or reproduce
Steps to reproduce:
Admin->Importand clickDownloading pending filesErrors like this will be seen for every file that gets downloaded:
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.