Skip to content

[Frontend] StreamCreationWizard.startPolling hits wrong URL and wrong shape #623

@ogazboiz

Description

@ogazboiz

Join the discussion on Telegram

Why this matters

frontend/src/components/stream-creation/StreamCreationWizard.tsx lines 328-354. The polling loop after submitting a stream:

const response = await fetch(\`/v1/streams?sender=\${senderAddress}\`);
const streams = await response.json();
if (streams && streams.length > 0) {
  const newStream = streams[0];
  ...
  router.push(\`/app/streams/\${newStream.streamId}\`);
}

Three bugs in one block:

  1. The fetch URL is a relative path (/v1/streams?...) — it will hit the Next.js origin (port 3000), not the backend on NEXT_PUBLIC_API_URL / 3001. So this will always 404 in development unless a Next proxy is configured (none is).
  2. streams.length is checked, but the backend returns { data, total, hasMore, limit, offset } (see backend/src/controllers/stream.controller.ts:198-204). So the truthy check fails or the wrong key is used.
  3. It uses senderAddress = formData.recipient (line 367) — it's polling for streams where the RECIPIENT is the sender field; that's a swapped role.

The path issue is the same family as #502, but startPolling is a separate function in a different file (the existing fix targets the wizard's post-submit flow elsewhere); the URL/shape problems were not addressed here.

Acceptance criteria

Files to touch

  • frontend/src/components/stream-creation/StreamCreationWizard.tsx (lines 328-354, 367)

Out of scope

  • Replacing polling with SSE

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingfrontendFrontend related tasksgood first issueGood for newcomers

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions