Skip to content

[bug] it is not possible to use context:0 ... N #1312

Description

@mpet

Describe the bug

We only wanted to see a summary for matching lines.

When using context:0 ... N in the search field
we get a crash in webserver.

Image

To reproduce

I tried:

Helpers context:0

or

Helpers context:1

Both failed.

Sourcebot deployment information

Sourcebot version:

Current version: v5.0.3(496b09a)

Additional information

No response

Activity

  1. rachit367 commented on Jun 23, 2026

    @rachit367
    Contributor

    Picking this up. Root cause: context:<value> parses as a named search-context lookup (ContextExpr), and when the context doesn't exist, onExpandSearchContext in features/search/parser.ts throws a plain Error instead of a ServiceErrorException. Only SyntaxError is caught and mapped to a clean response, so the plain error propagates and crashes the request. Fixing it to throw a ServiceErrorException with the existing SEARCH_CONTEXT_NOT_FOUND code so it returns a graceful 404.

  2. added a commit that references this issue on Aug 4, 2026
    a6c7695
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions