Skip to content

Error thrown inside setTimeout goes nowhere #256

@Retengart

Description

@Retengart

Problem

In startBackgroundSync, error is re-thrown inside setTimeout callback.

Current Behavior

// sync.ts:119-131
setTimeout(async () => {
    try {
        await this.handleSyncIndex();
    } catch (error) {
        if (/* unexpected error */) {
            throw error; // Goes nowhere!
        }
    }
}, 5000);

Throwing inside async setTimeout callback doesn't propagate - error is silently lost.

Impact

Unexpected errors during initial sync are swallowed, making debugging difficult.

Expected Behavior

Log error and/or emit event instead of throwing.

Location

  • packages/mcp/src/sync.ts:128-129

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions