Skip to content

feat: integration tests for full stream lifecycle via API#432

Merged
ogazboiz merged 5 commits intoLabsCrypt:mainfrom
MerlinTheWhiz:feat/integration-test-for-full-lifecycle-via-API
May 2, 2026
Merged

feat: integration tests for full stream lifecycle via API#432
ogazboiz merged 5 commits intoLabsCrypt:mainfrom
MerlinTheWhiz:feat/integration-test-for-full-lifecycle-via-API

Conversation

@MerlinTheWhiz
Copy link
Copy Markdown
Contributor

Closes #370

Changes made:

  • Added 10 integration tests covering full stream lifecycle
  • Tests use real PostgreSQL database
  • Verifies SSE EventSource broadcasts
  • Tests RPC fallback for stale data
  • All tests passing (10/10)

Screenshot of test run:
image

@ogazboiz
Copy link
Copy Markdown
Contributor

hey, main was failing CI from broken auth imports + frontend parse errors. fixed and pushed to main now. please rebase to pick up the fixes:

git fetch upstream
git rebase upstream/main
git push --force-with-lease

if there's a conflict, resolve it locally and we'll review once CI is green.

@MerlinTheWhiz MerlinTheWhiz force-pushed the feat/integration-test-for-full-lifecycle-via-API branch from 3e156c7 to 184688c Compare May 1, 2026 14:08
@ogazboiz
Copy link
Copy Markdown
Contributor

ogazboiz commented May 1, 2026

hey, main CI is fully green now. there were several real TypeScript and test issues from #444's merge that have all been fixed. please rebase one more time:

git fetch upstream
git rebase upstream/main
git push --force-with-lease

your PR's diff should be much cleaner after this rebase since main now has the canonical versions of cancel.ts, sorobanService.ts, and the withdraw test.

@MerlinTheWhiz MerlinTheWhiz force-pushed the feat/integration-test-for-full-lifecycle-via-API branch from 184688c to 29d3682 Compare May 1, 2026 22:48
@MerlinTheWhiz
Copy link
Copy Markdown
Contributor Author

MerlinTheWhiz commented May 1, 2026

@ogazboiz frontend still fails even after rebase. It's odd though because everything passes in the last pr you merged.

Let me check the issue

image

@MerlinTheWhiz
Copy link
Copy Markdown
Contributor Author

@ogazboiz Just to be clear, I didn't work on frontend, so it's not on my end as seen in the screenshot below. But I've seen a couple issues that I'll be resolving in it

image

@MerlinTheWhiz
Copy link
Copy Markdown
Contributor Author

@ogazboiz Yup, I found the issue. One of the files I'm currently making changes to never passed the check but somehow all the checks are good.

You can confirm all these before merging my work. Check all frontend files I'm about to make changes to now:

image

Copy link
Copy Markdown
Contributor

@ogazboiz ogazboiz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hey @MerlinTheWhiz, the integration test in backend/tests/integration/stream-lifecycle.test.ts looks great — 701 lines covering the full event worker → DB → controller → SSE pipeline. that's exactly what #370 needed.

but i ran lint on main locally and it passes with only 1 unused-import warning. the ~17k line frontend changes in this PR aren't lint error fixes — they're mass prettier reformatting (single quotes → double, 4-space → 2-space indent, inline → multi-line objects). this is risky for a few reasons:

  1. scope — this PR is "integration tests for stream lifecycle" but 99% of the diff is unrelated formatting.
  2. conflict surface — reformatting every frontend file will conflict with every other in-flight frontend PR.
  3. wrong patterns introduced — i spotted these in frontend/src/app/activity/page.tsx:
    • useCallback deps changed from [session?.publicKey] to [session] — this will cause unnecessary re-renders when other session fields change.
    • setPage(1) and fetchActivity(1, ...) wrapped in setTimeout(..., 0) — this is a hack to suppress a missing-dep warning rather than a fix. shouldn't be merged.

could you split this into two PRs?

  1. this PR — only backend/tests/integration/stream-lifecycle.test.ts + the eventsource dep in package.json. that closes #370 cleanly.
  2. separate PR — frontend prettier formatting, without the activity page logic changes (revert those). if we want consistent formatting we should either run prettier across the whole frontend in one go or set up a pre-commit hook.

the test is solid work — let's get just that part merged first.

@MerlinTheWhiz MerlinTheWhiz force-pushed the feat/integration-test-for-full-lifecycle-via-API branch from 59309eb to 29d3682 Compare May 2, 2026 00:09
Copy link
Copy Markdown
Contributor

@ogazboiz ogazboiz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hey @MerlinTheWhiz, sorry for the back and forth — you were right that ci was failing for real reasons. the root package-lock had bumped eslint-plugin-react-hooks to 7.1.1 which has stricter react-compiler rules that catch existing setState-in-effect issues in main's frontend (not your code). pushed a revert of the root lockfile to your branch so it aligns with main.

solid integration test work — full event worker → DB → controller → SSE pipeline, 700+ lines covering the lifecycle. closes #370. merging!

if you want to keep contributing, join us on Telegram: https://t.me/+DOylgFv1jyJlNzM0

@ogazboiz ogazboiz merged commit b2ef1cc into LabsCrypt:main May 2, 2026
8 of 9 checks passed
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.

Write integration tests for full stream lifecycle via API

2 participants