Skip to content

Fix missing return statement in gfn success path #19

@e-gineer

Description

@e-gineer

Bug Description

In index.js, the gfn function's success path (line 601) is missing a return statement, causing the handler to return undefined instead of the value from finalize().

Current Behavior

// Line 601 - success path (BUG):
await finalize(event, context, init, finalError, finalResult);

Expected Behavior

// Line 638 - error path (correct):
return await finalize(event, context, init, finalError, finalResult);

Impact

  • TURBOT_TEST mode: The handler returns undefined instead of { result, turbot: processEvent }, breaking test assertions on turbot process events
  • Production mode: Returns undefined instead of null (inconsistent with error path)

Fix

Add return before await finalize(...) on line 601.

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