simonsobs / simonsobs/lightview

Null-stat crash on source page and hanging cone search on error

Open
#70 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
0
Forks
0
Avg merge
2d 21h
Merged PRs (30d)
1

Description

Two related bugs, both about the frontend not handling expected/error conditiongracefully — fixes are ready o-fixes, commit a11bf01) butblocked on push access to this repo.

  1. Source page crashes with "Oops! Something went wrong. can't access property 'toPrecision', stat is null"
    SourceHeader.tsx's format() fuat being a string, not null:
    function format(key, stat) {
    if (typeof stat === 'string') return st const sigFigs = statsKeysToD
    if (sigFigs !== null) { return stat.toPrecision(si null
    } ...
    }
    lightserve legitimately returns null for stddev_flux/weighted_mean_fluxwhen a source has too fewmeasurements to compute them (e.g. exactly 1 measurement — no variance is defined). This isn't a backend bug, just an en't handle.

Fix: handle null explicitly inpdated the SourceStatisticstype to mark those three fields as number | null.

  1. Cone search hangs on "Searching..." forever if the request fails

SearchResults.tsx's search effect has no error handling:

async function getSearchResults() {
if (params['*'] === 'cone' &
const searchResponse = await lightcurveApi.getNearbySources(location.search);
...
}
}

Any failure (e.g. a 400 from tled promise rejection — results never gets set, and the page is stuck showing "Searching..." indefinitely. There's
already an error state wired i>{error} :) but it wasnever actually set anywhere.

Fix: wrapped the fetch in try/catch and set the existing error state on failure, so a
failed search shows a message


Both fixes are already implemented and committed — just need someone with push access to this repo to pull the branch or have my access sorted out so I can push general-bug-fixes

Contributor guide

No contributing guide indexed for this repository

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.

Research direction

Read SourceHeader.tsx's format() function and SearchResults.tsx's cone-search effect, then inspect commit a11bf01. The work is done when null source statistics no longer crash the source page and a failed cone search displays the existing error message instead of remaining on "Searching...".

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.