Stream description inconsistency between Input Wizard and Streams screen

Open Beginner friendly
#25,216 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
76/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Quiet
Tech stack
mongodb, typescript

Research direction

Start with graylog2-web-interface/src/components/inputs/InputSetupWizard/steps/components/CreateStreamForm.tsx and compare its description handling with StreamModal.tsx. Read useSetupInputMutations.ts and useStreamMutations.ts, then verify both creation paths store the description field consistently as an empty string when no description is entered.

Written by the indexing model from the issue text.

Description

bug frontend triaged

Expected Behavior

When a Stream is created with an empty description, the stored value for the description field should be consistent regardless of which UI path was used to create the stream.

Current Behavior

When creating a Stream with an empty description from the Streams screen, the backend receives an empty string "" for the description field. When creating a Stream with an empty description from the Input Setup Wizard (Routing step), the description field is omitted entirely from the MongoDB document.

Possible Solution

Update CreateStreamForm.tsx to default the description initial value to '' (empty string) instead of undefined, matching the behavior of StreamModal.tsx.

Steps to Reproduce (for bugs)

  1. Create a Stream from the Streams screen (e.g. "test-stream-no-desc-0") and leave the description field empty.
  2. Create a Stream from the Input Setup Wizard (e.g. "test-stream-no-desc-1") by selecting "Create new stream" in the Routing step and leave the description field empty.
  3. Query MongoDB to compare the stored values:
    db.streams.find(
      {title: {$in: ["test-stream-no-desc-0", "test-stream-no-desc-1"]}},
      {title: 1, description: 1}
    ).forEach(s => {
      print(s.title + " → description: " + JSON.stringify(s.description) + " (type: " + typeof s.description + ")")
    })
    
  4. Observe the output:
    test-stream-no-desc-0 → description: "" (type: string)
    test-stream-no-desc-1 → description: undefined (type: undefined)
    

Context

The inconsistency originates from different default values used in the two creation forms:

  • StreamModal.tsx (Streams screen) defaults description to '' (line 71).
  • CreateStreamForm.tsx (Input Setup Wizard) defaults description to undefined (line 101), and useSetupInputMutations.ts also explicitly sets description: undefined (line 41) before spreading the stream object.

When undefined is serialized to JSON, the key is omitted entirely, so the backend's @Nullable description field in CreateStreamRequest.java deserializes it as null. Jackson then omits null values when writing to MongoDB, so the field is absent from the document entirely.

Relevant files:

  • graylog2-web-interface/src/components/streams/StreamModal.tsx
  • graylog2-web-interface/src/components/inputs/InputSetupWizard/steps/components/CreateStreamForm.tsx
  • graylog2-web-interface/src/components/inputs/InputSetupWizard/hooks/useSetupInputMutations.ts
  • graylog2-web-interface/src/hooks/useStreamMutations.ts

Your Environment

  • Graylog Version: 7.1.0-SNAPSHOT (5bc5da03d2)
  • Java Version: 21
  • OpenSearch Version: opensearchproject/opensearch:2.19.3
  • MongoDB Version: mongo:7.0
  • Operating System: macOS 26.3
  • Browser version: Chrome 145.0.0.0

Checklist

  • This issue fix need to be backported.
  • Does this issue have security implications?
Dominant language
Java
Stars
8.1k
Forks
1.1k
Avg merge
1d 17h
Merged PRs (30d)
204

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Graylog2/graylog2-server

All issues in Graylog2/graylog2-server

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.