Rocket.Chat icon indicating copy to clipboard operation
Rocket.Chat copied to clipboard

Refactor: Migrate insertMessage function to service layer

Open krishiekrashie opened this issue 5 months ago • 3 comments

/apps/meteor/app/lib/server/functions/insertMessage.ts is used by MessageConverter.ts (/apps/meteor/app/importer/server/classes/converters/MessageConverter.ts) in importing messages, but it does so via importing it directly rather than through importing the Message object from core-services. It is not added IMessageService.ts (packages/core-services/src/types/IMessageService.ts) or the class service.ts.

krishiekrashie avatar Jun 13 '26 11:06 krishiekrashie

Hi maintainers,

I would love to take on this refactoring task. I can migrate insertMessage into the IMessageService interface and its corresponding class service implementation, then update MessageConverter.ts to consume it via core-services instead of a direct file import.

Could you please assign this issue to me?

prathamesh04 avatar Jun 14 '26 06:06 prathamesh04

Hi, I actually wasn't sure if this is completely valid issue. Can i please work on this?

krishiekrashie avatar Jun 14 '26 07:06 krishiekrashie

Hi @krishiekrashie, absolutely! Since you opened the issue, it’s all yours. Feel free to use the implementation path I mentioned above if it helps. Let me know if you run into any blocks—happy to review the PR or help out if needed!

prathamesh04 avatar Jun 14 '26 07:06 prathamesh04