Skip to content

[Bug]: Misleading "app not started" error when manifest.name is not configured (breaking change in v2.0.3) #415

@taivon

Description

@taivon

Bug Description

After upgrading from @microsoft/teams.apps v2.0.2 to v2.0.4, calls to app.send() fail with the error "app not started" even though the app has successfully started.

The root cause is a breaking change introduced in PR #387 (released in v2.0.3). The
app.name getter was changed from reading the bot's display name from tokens to reading from the manifest.name constructor option:

Before (v2.0.2) - app.ts L136-L138:

get name() {
  return this.tokens.bot?.appDisplayName;
}

After (v2.0.3+) - app.ts L175-L177:

get name() {
 return this._manifest.name?.full;
}

The send() method checks if (!this.id || !this.name) and throws "app not started", but this error message is misleading because:

  1. The app is started (app.start() completed successfully)
  2. The actual issue is that manifest.name was not provided in the constructor

This is a breaking change that affects any code I had using app.send() for proactive messaging.

Steps to Reproduce

  1. Install @microsoft/teams.apps v2.0.3 or later
  2. Create an App instance without the manifest.name option:
const app = new App({
  clientId: "...",
  clientSecret: "...",
  tenantId: "...",
});
  1. Start the app and call app.send():
    await app.start(3978);
    await app.send(conversationId, "Hello"); // Throws "app not started"

Expected Behavior

Either:

  • The error message should indicate the actual problem (e.g., "manifest.name is required for app.send()")
  • Or the SDK should fall back to this.tokens.bot?.appDisplayName for backwards compatibility

Actual Behavior

Throws Error: app not started which is misleading

Workaround: Add manifest.name to the App constructor:

const app = new App({
  clientId: "...",
  clientSecret: "...",
  tenantId: "...",
  manifest: {
    name: { short: "MyApp", full: "My Application" },
  },
});

SDK Version

2.0.4

Node.js Version

24.5.0

Additional Context

No response

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions