Skip to content

Bug: lookupByUAL returns OK on internal errors, masking failures #79

@Bojan131

Description

@Bojan131

Description

In packages/query/src/query-handler.ts, the lookupByUAL method catches all errors and returns a success response (OK) with empty data, effectively masking database failures and other internal errors.

Impact

  • High severity — If the Oxigraph storage is down or a query fails, the caller receives a "success" response with no data instead of an error. This makes it impossible to distinguish between "no data exists" and "the database is broken".
  • Debugging production issues becomes extremely difficult because errors are silently swallowed.
  • Clients may incorrectly assume a UAL doesn't exist when the underlying storage is actually failing.

Code Pattern

The problematic pattern (approximate):

async lookupByUAL(ual: string) {
  try {
    // ... query storage ...
    return { status: 'OK', data: results };
  } catch (err) {
    // BUG: Returns success with empty data instead of propagating the error
    return { status: 'OK', data: [] };
  }
}

Suggested Fix

The catch block should return an error status:

catch (err) {
  log.error('lookupByUAL failed:', err);
  return { status: 'ERROR', error: err.message };
}

Location

packages/query/src/query-handler.tslookupByUAL method.

Metadata

Metadata

Assignees

No one assigned

    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