RocketChat/Rocket.Chat · warning

Failed to import the parent comment; missing replies/reply_u

Error message

Failed to import the parent comment; missing replies/reply_users field

What it means

SlackImporter warning while converting a thread's parent message: message.thread_ts equals message.ts (this is the thread head) but the export carries neither reply_users nor replies, so the Rocket.Chat replies participant list cannot be rebuilt. tcount and tlm are still set from reply_count/latest_reply; only the replies array is lost. Non-fatal.

Source

Thrown at apps/meteor/server/lib/import/slack/SlackImporter.ts:631

							const replies = new Set<string>();
							message.reply_users.forEach((item: string) => {
								replies.add(this._replaceSlackUserId(item));
							});

							if (replies.size) {
								newMessage.replies = Array.from(replies);
							}
						} else if (message.replies) {
							const replies = new Set<string>();
							message.replies.forEach((item: { user: string }) => {
								replies.add(this._replaceSlackUserId(item.user));
							});

							if (replies.size) {
								newMessage.replies = Array.from(replies);
							}
						} else {
							this.logger.warn({
								msg: 'Failed to import the parent comment; missing replies/reply_users field',
								messageId: newMessage._id,
							});
						}

						newMessage.tcount = message.reply_count;
						newMessage.tlm = new Date(parseInt(message.latest_reply.split('.')[0]) * 1000);
					} else {
						newMessage.tmid = this.makeSlackMessageId(slackChannelId, message.thread_ts);
					}
				}

				if (message.edited) {
					newMessage.editedAt = new Date(parseInt(message.edited.ts.split('.')[0]) * 1000);
					if (message.edited.user) {
						newMessage.editedBy = this._replaceSlackUserId(message.edited.user);
					}
				}

View on GitHub (pinned to b2c16d5842)

Solutions

  1. Accept the loss - only the replies participant list is missing; the thread children still import via tmid
  2. Re-export from Slack with current export tooling, which includes reply_users
  3. If thread fidelity matters, post-process: rebuild replies from the imported child messages' u._id values
Defensive patterns

Strategy: fallback

Validate before calling

// Post-process: rebuild a missing parent replies list from imported child messages
const replies = await Messages.find({ tmid: parentId }, { fields: { 'u._id': 1 } }).toArray();
if (replies.length) {
  await Messages.updateOne({ _id: parentId }, { $set: { replies: [...new Set(replies.map((m) => m.u._id))] } });
}

Prevention

When it happens

Trigger: Older Slack export formats that did not include reply_users on thread parents; exports where participants deleted accounts; hand-modified export files that dropped those fields.

Common situations: Thread metadata partially lost in migration - reply counts survive but the participant list is empty; admins noticing thread replies list inconsistencies after Slack imports.

Related errors


AI-assisted analysis of RocketChat/Rocket.Chat@b2c16d5842 (2026-08-18). Data as JSON: /api/errors/85b2e922a33ddff0. Report an issue: GitHub.