RocketChat/Rocket.Chat · error · Error

Unrecognized typing scope provided

Error message

Unrecognized typing scope provided

What it means

Thrown by AppMessageBridge.typing when scope is neither 'room' nor any other recognized value, i.e. the default branch of the switch. Currently only 'room' scope is implemented; any other scope string is unsupported and rejected.

Source

Thrown at apps/meteor/app/apps/server/bridges/messages.ts:116

		await Users.findByIds(users, { projection: { _id: 1 } }).forEach(
			({ _id }: { _id: string }) =>
				void api.broadcast('notify.ephemeralMessage', _id, room.id, {
					...convertedMessage,
				}),
		);
	}

	protected async typing({ scope, id, username, isTyping }: ITypingDescriptor): Promise<void> {
		switch (scope) {
			case 'room':
				if (!username) {
					throw new Error('Invalid username');
				}

				notifications.notifyRoom(id, 'user-activity', username, isTyping ? ['user-typing'] : []);
				return;
			default:
				throw new Error('Unrecognized typing scope provided');
		}
	}

	private isValidReaction(reaction: Reaction): boolean {
		return reaction.startsWith(':') && reaction.endsWith(':');
	}

	protected async addReaction(messageId: string, userId: string, reaction: Reaction): Promise<void> {
		if (!this.isValidReaction(reaction)) {
			throw new Error('Invalid reaction');
		}

		return executeSetReaction(userId, reaction, messageId, true);
	}

	protected async removeReaction(messageId: string, userId: string, reaction: Reaction): Promise<void> {
		if (!this.isValidReaction(reaction)) {
			throw new Error('Invalid reaction');

View on GitHub (pinned to f9d3ec372b)

Solutions

  1. Use exactly scope: 'room' for typing notifications in the current version.
  2. Check for case-sensitivity and trailing whitespace in the scope string.
  3. Confirm the ITypingDescriptor scope union against the installed apps-engine/bridge version.
  4. If a new scope is needed, verify the bridge supports it before using it (file an issue otherwise).

Example fix

// before
await app.getModify().typing({ scope: 'user', id: userId, username, isTyping: true });

// after
// only 'room' scope is supported by the message typing bridge
await app.getModify().typing({ scope: 'room', id: room.id, username, isTyping: true });
Defensive patterns

Strategy: validation

Validate before calling

const SUPPORTED_TYPING_SCOPES = new Set(['room']);
if (!SUPPORTED_TYPING_SCOPES.has(descriptor.scope)) {
  throw new Error(`Unsupported typing scope '${descriptor.scope}'. Supported: room`);
}
await app.getModify().typing(descriptor);

Type guard

const isSupportedTypingScope = (scope: string): scope is 'room' => scope === 'room';

Try / catch

try {
  await app.getModify().typing(descriptor);
} catch (e) {
  if ((e as Error).message.includes('Unrecognized typing scope')) {
    // downgrade to room scope or skip the typing indicator
  }
  throw e;
}

Prevention

When it happens

Trigger: An App calls the typing notifier with a scope value other than 'room' (e.g. 'user', 'channel', or a typo like 'Room'/'rooms'), hitting the default branch.

Common situations: App passes a future/planned scope not yet implemented; typo or wrong casing in the scope literal; App copies a scope constant from another accessor that does not apply to typing; version mismatch where the apps-engine defines scopes the bridge does not yet handle.

Related errors


AI-assisted analysis of RocketChat/Rocket.Chat@f9d3ec372b (2026-08-12). Data as JSON: /api/errors/97b68d263b15ec51. Report an issue: GitHub.