RocketChat/Rocket.Chat · error

Invalid app provided

Error message

Invalid app provided

What it means

UiInteractionBridge.notifyUser resolves the calling app through the orchestrator's app manager before broadcasting a UIKit interaction to a user; when getOneById(appId) returns undefined the bridge throws 'Invalid app provided'. The appId on the call does not match any currently loaded app.

Solutions

  1. Only send interactions as the running app: use the runtime app id, never a persisted or hard-coded one.
  2. Guard scheduled tasks: verify the app is still active before pushing UI updates.
  3. If the app was reinstalled, refresh any stored references to its id.

Example fix

// before
const appId = persistedAppId; // stale after reinstall
await notifyUser(user, interaction, appId);

// after
const appId = this.getAppId(); // identity of the running app instance
await notifyUser(user, interaction, appId);
Defensive patterns

Strategy: validation

Validate before calling

const appId = this.getAppId();
if (!appId) {
  return; // not running inside an active app context
}

Type guard

const isNonEmptyString = (v: unknown): v is string =>
  typeof v === 'string' && v.trim().length > 0;

Try / catch

Catch and drop with a log line: the sender app no longer exists, so the interaction cannot be delivered.

Prevention

When it happens

Trigger: App sends a UIKit interaction (notifyUser) while being uninstalled, disabled, or reloaded; appId is malformed or hard-coded; a queued/scheduled interaction is flushed after the app was removed.

Common situations: Scheduled notifications outliving the app instance; dev-mode hot reload dropping the app from the manager; app ids persisted across reinstalls (reinstall generates a new identity).

Related errors


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

Appendix: source

Thrown at apps/meteor/app/apps/server/bridges/uiInteraction.ts:19

import type { IAppServerOrchestrator } from '@rocket.chat/apps';
import { UiInteractionBridge as AppsEngineUiInteractionBridge } from '@rocket.chat/apps/dist/server/bridges/UiInteractionBridge';
import type { IUIKitInteraction } from '@rocket.chat/apps-engine/definition/uikit';
import type { IUser } from '@rocket.chat/apps-engine/definition/users';
import { api } from '@rocket.chat/core-services';
import type * as UiKit from '@rocket.chat/ui-kit';

export class UiInteractionBridge extends AppsEngineUiInteractionBridge {
	constructor(private readonly orch: IAppServerOrchestrator) {
		super();
	}

	protected async notifyUser(user: IUser, interaction: IUIKitInteraction, appId: string): Promise<void> {
		this.orch.debugLog(`The App ${appId} is sending an interaction to user.`);

		const app = this.orch.getManager()?.getOneById(appId);

		if (!app) {
			throw new Error('Invalid app provided');
		}

		void api.broadcast('notify.uiInteraction', user.id, interaction as UiKit.ServerInteraction);
	}
}

View on GitHub (pinned to b2c16d5842)