Skip to content

frontend requests non-existent proposal 0 #6

Description

@robnagler

the pykern WebSocket server receives a table call for proposal '0' which does not exist, causing a RuntimeError.

Root cause: state.metadata.proposal.value starts as '' (empty string from initialState), but somewhere during initialization it briefly transitions through '0' before settling on the real proposal number (e.g. '9001'). The !proposal guard in usePagination only catches falsy values — '0' is truthy — so effects fire prematurely with the wrong proposal.

The fetchTableMetadata condition (runs.length === 0) passed because Redux state was empty at that moment, allowing a metadata fetch for proposal '0'. When metadata arrives for the real proposal (e.g. from use-proposal.ts via updateTable), hasMetadata becomes true while proposal is still '0', triggering a getTableViaPykernApi call for the wrong proposal.

Where '0' comes from: needs further investigation — likely useParams() or route matching returning '0' transiently during navigation.

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