Skip to content

Fix #1435–#1438: useMarkets races, repo cleanup, and Frontend CI lockfile - #1490

Merged
Ehonrie merged 5 commits into
Netwalls:mainfrom
colemaya95-ctrl:fix/1435-1436-1437-1438-frontend-ci
Oct 21, 2026
Merged

Ehonrie merged 5 commits into
Netwalls:mainfrom
colemaya95-ctrl:fix/1435-1436-1437-1438-frontend-ci

Conversation

@colemaya95-ctrl

Copy link
Copy Markdown
Contributor

Summary

Four fixes, one commit each, so each can be reviewed and reverted on its own.

  • F-97: Fix race conditions and loading flicker in useMarkets #1435 (F-97): useMarkets race conditions and loading flicker. Only the newest request may write state, so a slow earlier response can't overwrite newer data. isLoading is now true only for the first load; background polls and refetches set a new isRefreshing flag, so the list no longer swaps for skeletons every 30 s. useVisibilityInterval no longer fires on mount, which removes the duplicate request the initial load was already making.
  • F-98: Finish F-44/F-45: untrack frontend/.next and delete Storybook boilerplate #1436 (F-98): finish F-44/F-45. Untracks the 95 frontend/.next build files still in the index (about 27 MiB of blobs leave the tracked tree; working copies stay on disk). Deletes the default Storybook scaffolding (Page, Header, their CSS, and assets/). Nothing outside stories/ referenced them.
  • F-99: Delete stray root-level components/, hooks/ and treasury_changes.txt #1437 (F-99): delete stray root-level files. Removes components/TransactionStatusModal.tsx, hooks/useMarkets.ts and treasury_changes.txt. The root copies were obsolete, importing ../lib/api and ../types/market, which don't exist at the root. Nothing references them.
  • F-100: Make Frontend CI pass: regenerate package-lock.json (still out of sync after #1333) #1438 (F-100): make Frontend CI pass. Regenerates frontend/package-lock.json with Node 20. The old lock pinned @stellar/freighter-api@2.0.0 against ^6.0.1 and was missing several devDependencies, so npm ci failed. Adds a "Verify package-lock.json is in sync" step to both jobs in frontend-ci.yml that fails early if regenerating the lock changes it.

Testing

  • useMarkets.test.ts: 14/14 pass. Added tests for out-of-order responses, stale errors, and background polling without loading flicker. The "returns to loading while a refetch is in flight" test is replaced because it encoded the old isLoading behaviour.
  • Full frontend Jest run: the failing suites are a strict subset of main's (25 failing suites on main, 24 here). No new failures.
  • npm ci passes on a clean copy of package.json plus the regenerated lock under Node 20.
  • The sync guard was checked both ways: it passes on a synced lock and fails on a package.json change without a lock update.

Known issues not addressed here

tsc --noEmit reports pre-existing syntax errors in frontend/hooks/usePayoutEstimate.ts (line 62) and frontend/hooks/useWallet.ts (line 240). They are outside these issues and still need fixing for the type-check job to pass.

Closes #1435
Closes #1436
Closes #1437
Closes #1438

colemaya95-ctrl and others added 5 commits October 19, 2026 02:52
…eMarkets

- Ignore responses from superseded requests so a slow earlier fetch
  cannot overwrite newer results.
- Limit isLoading to the first load; background polls and refetches
  report isRefreshing instead, so the list no longer flashes skeletons
  every 30 s.
- useVisibilityInterval no longer fires on mount, removing the duplicate
  request that the initial load already made. It still fires immediately
  when the tab becomes visible again.
- Tests cover out-of-order responses, stale errors, and polling without
  loading flicker.

Closes Netwalls#1435
…emove Storybook boilerplate

- git rm --cached frontend/.next: 95 generated build files were still
  tracked despite the .gitignore entry. Working copies are kept on disk.
- Delete the default Storybook scaffolding (Page, Header, their CSS and
  the assets folder). Nothing outside stories/ referenced them, and
  .storybook/main.ts only globs stories/**.

About 27 MiB of blobs are dropped from the tracked tree.

Closes Netwalls#1436
…nd treasury_changes.txt

- components/TransactionStatusModal.tsx and hooks/useMarkets.ts are
  obsolete copies of the frontend files. They import ../lib/api and
  ../types/market, which do not exist at the repo root, so they could
  never have compiled there.
- treasury_changes.txt is a UTF-16 patch dump of contracts/treasury with
  no consumers.
- Nothing in the repo, CI, or docs imports or references them.

Closes Netwalls#1437
…e-lock.json

- Regenerate frontend/package-lock.json with the npm version CI uses
  (Node 20). The old lock pinned @stellar/freighter-api@2.0.0 while
  package.json requires ^6.0.1, and it was missing several devDependencies
  (@playwright/test, @storybook/test-runner, concurrently, wait-on, ...),
  so `npm ci` failed on every run.
- Verified `npm ci` succeeds on a clean copy of package.json and the new
  lock under Node 20.
- frontend-ci.yml: add a "Verify package-lock.json is in sync" step before
  npm ci in both jobs. It regenerates the lock and fails if it changes, so
  a package.json edit without a matching lock fails early with a clear
  message.

Closes Netwalls#1438
@Ehonrie
Ehonrie merged commit 846dff6 into Netwalls:main Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants