Skip to content

fix: Volume sort with the 1h/24h windows 502s on production, three small token and launch fixes, a cached picture-ownership read - #79

Merged
kevincodex1 merged 6 commits into
mainfrom
fix/home-live-bugs-r2
Oct 7, 2026
Merged

kevincodex1 merged 6 commits into
mainfrom
fix/home-live-bugs-r2

Conversation

@kevincodex1

@kevincodex1 kevincodex1 commented Oct 7, 2026 •

Copy link
Copy Markdown
Member

What this fixes

1. The home list's Volume sort with the 1h or 24h window returns 502. This is live on production today.
GET /api/launch/list?sort=volume&window=1h and window=24h both return 502 on openlaunch.lol, and the home page then shows an empty list with "Try again". The window volumes live on the lateral w as v1 and v24; the ORDER BY named w1.v and w24.v, which do not exist. The column per window is now one table that a test checks against the query (a second test pins that listLaunchesPage really uses it). Two things around it: a failed list read now shows an inline error with Try again, and picking a view on the home page changes the address with history.replaceState instead of re-rendering the page on the server, where a failing render unmounted the whole page.

2. TWIG first-buy chip. The middle chip read "3M" while the value it sets is 2,500,000: the label was rounded with fmtCompact(v, 0). It now uses fmtQuoteUnits like the other chips, which keeps two fraction digits ("2.5M").

3. Token page, trades list. The scroller is now a positioned ancestor. Each row's screen-reader label is absolutely positioned, and with a static scroller it escaped the scroller's clipping and stretched the page's scrollable area, leaving blank space under the footer after a long tape.

4. Token page, slow image store. The logo tint read the stored image with no timeout, so a slow store could hang the page. The read now has a 3 s abort signal and a race that also covers a stalled body; a timeout counts as a miss and the page falls back to the avatar tint.

5. Feed, picture-ownership read (CodeRabbit's note on #78). The check for a copied hero picture reads bb_launch_meta with an ILIKE, which is a scan: about 32 ms at production's size (5,400 rows, 24 keys, measured on a stand-in table), and the home page asks on every render. It is now cached for 30 s per set of pictures (the cache is bounded and a failure is not cached). Stale is safe: a copy is judged against the earliest registration, which is older than any copy and already in the answer, and a launch with a new picture changes the set, so it is read fresh. Behaviour is otherwise the same, including failing closed. (The "about 350 rows" in #78's deploy notes was my local copy of the data; production has far more, which is why this matters.)

Verified

  • Same data, before and after. On main's code: the list API returns 502 for Volume with 1h and with 24h, and the home page shows 0 rows and "Try again". On this branch: both return 200 and the page shows 40 rows with no error. Every other combination answers the same as before.
  • tsc and eslint: 0 problems. 1,055 tests: 1,045 pass, 10 skipped, 0 fail.
  • The feed with the cached read, read twice: no launch flagged as a copy, no read failures logged.
  • Rebased onto main after ui(home): the redesigned home page: locker, live Trending board, phone-first layout #78 merged. One trivial conflict in LaunchList.tsx (both sides added a line next to each other); I kept both.

Deploy notes

No schema change and no new environment variable. It can ship with #78 or after it. This branch replaces fix/home-live-bugs, which was based on the old main and is left as it was.

Summary by CodeRabbit

  • Bug Fixes
    • First-buy preset amounts now display consistently, including large values.
    • Launch list selection and pagination errors now show an inline alert with a retry option.
    • Changing selections on the home page updates the address without navigating away.
    • Image reads now return safely on failure or timeout, helping prevent stalled requests.

…d a failed list stays inline

The window volumes live on the lateral w as v1 and v24; the ORDER BY named w1.v and w24.v, which do not exist.
The column per window is now one table the test checks against the query. A failed list read shows an inline
error with Try again, and picking a view on the home page changes the address with history.replaceState instead
of re-rendering the page on the server, where a failing render unmounted it.
The chip rounded the label with fmtCompact(v, 0) while the value set was 2,500,000. It now uses fmtQuoteUnits like the
other chips, which keeps two fraction digits.
…ape no longer leaves blank space under the footer

Each row's sr-only label is absolutely positioned; with a static scroller it escaped the scroller's clipping and
stretched the page's scrollable area.
The tint reads the stored logo with GetObject, which had no timeout. The read now carries a 3 second abort signal and
a race that also covers a stalled body; a timeout is a miss, so the page falls back to the avatar tint.
The existing test checked the table against the query's aliases but not that
listLaunchesPage uses it, so typing w1.v / w24.v back in would still pass. It
now fails on those aliases.
… render

#78's check for a copied hero picture reads bb_launch_meta with an ILIKE over the
feed's picture keys. That is a scan: about 32 ms at production's size (5,400
rows, 24 keys, measured on a stand-in table), and the home page asks on every
render. CodeRabbit flagged it on #78.

The read is now cached for 30 s per set of pictures (memo, bounded, a failure is
not cached). Stale is safe: a copy is judged against the earliest registration,
which is older than any copy and already in the answer, and a launch with a new
picture changes the set, so it is read fresh. Behaviour is otherwise unchanged,
including failing closed when the read fails.
@coderabbitai

coderabbitai Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: 50194bc9-d2fa-4cb9-81d9-cfec51b00981
📥 Commits

Reviewing files that changed from the base of the PR and between 6842d09 and de12d87.

📒 Files selected for processing (13)
  • app/src/components/launchpad/LaunchForm.tsx
  • app/src/components/launchpad/LaunchList.tsx
  • app/src/components/launchpad/TokenTrades.tsx
  • app/src/components/launchpad/home-floor.test.ts
  • app/src/components/launchpad/launch-form.test.ts
  • app/src/components/launchpad/list-load-errors.test.ts
  • app/src/components/launchpad/token-page.test.ts
  • app/src/components/launchpad/trending-strip.test.ts
  • app/src/lib/launchpad/image-store.test.ts
  • app/src/lib/launchpad/imageStore.ts
  • app/src/lib/launchpad/math.test.ts
  • app/src/lib/launchpad/queries.ts
  • app/src/lib/launchpad/volume-window.test.ts

Included review availability: This review used your included allowance. 3 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour.


📝 Walkthrough

Walkthrough

The changes update launchpad list navigation and retries, first-buy amount formatting, trade-history layout, S3 image reads, and launch query construction and caching.

Changes

Launchpad list loading

Layer / File(s) Summary
Selection loading and retry
app/src/components/launchpad/LaunchList.tsx, app/src/components/launchpad/home-floor.test.ts, app/src/components/launchpad/list-load-errors.test.ts
Selection loading builds API parameters from the selection. On the home page, URL updates use history.replaceState; other paths use router.replace. Load errors record whether selection or pagination failed and provide a matching retry. Tests check request parameters, error handling, and URL updates.

Launchpad display updates

Layer / File(s) Summary
Preset formatting and trade layout
app/src/components/launchpad/LaunchForm.tsx, app/src/lib/launchpad/math.test.ts, app/src/components/launchpad/launch-form.test.ts, app/src/components/launchpad/TokenTrades.tsx, app/src/components/launchpad/token-page.test.ts
First-buy preset amounts use fmtQuoteUnits. The trade-history scroll container gains relative positioning. Tests cover the preset formatting and trade-container contract.

S3 image reads

Layer / File(s) Summary
Timed S3 reads
app/src/lib/launchpad/imageStore.ts, app/src/lib/launchpad/image-store.test.ts
readObject returns object bytes or null, with a default timeout of three seconds. It aborts timed-out requests and handles stalled body reads. readImage uses the helper for S3 reads. Tests cover timeout, rejection, and successful reads.

Launch query updates

Layer / File(s) Summary
Volume-window SQL selection
app/src/lib/launchpad/queries.ts, app/src/lib/launchpad/volume-window.test.ts
VOLUME_COLUMN_SQL maps volume windows to SQL expressions, and listLaunchesPage selects an expression from that mapping. Tests check the aliases and expression references.
Picture ownership query caching
app/src/lib/launchpad/queries.ts, app/src/components/launchpad/trending-strip.test.ts
pictureCopies sorts picture keys and memoizes its ownership query for 30 seconds. A test checks the sorted-key cache behavior.

Priority: ⬆️ High

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Bug fix

Suggested reviewers: vasanthdev2004

Merge Risk: ⚪ Minimal · up to de12d

The change fixes the volume-sort 502 for the 1h and 24h windows, corrects the first-buy chip formatting, adds list retry handling, and adds timeouts and caching to image and ownership reads. No merge-blocking risk was identified.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 76.92% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 13 functions across 13 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title identifies the production 502 fix for 1h/24h volume sorting and summarizes other changes in the pull request. It is long, but it is specific and related to the changes.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@kevincodex1
kevincodex1 merged commit 4777602 into main Oct 7, 2026
7 checks passed
@kevincodex1
kevincodex1 deleted the fix/home-live-bugs-r2 branch October 7, 2026 07:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant