Slow-query log fields, price-change sign test, holders quantity-sort test#617
Merged
Chucks1093 merged 3 commits intoJul 24, 2026
Merged
Conversation
…erorg#604) Seeds four holders (quantities 5, 1, 10, 3) for a creator and asserts the /creators/:id/holders endpoint returns them in descending order (10, 5, 3, 1) with correct key_balance/wallet_address fields, plus a single-holder scenario. The endpoint already sorted by balance desc by default (covered generically by the existing creator-holders-sort.test.ts); this test locks in the exact scope from the issue.
The price_change_24h field already exists on the creator detail response (creator-profile.service.ts, computed via compute24hPriceChange), and existing tests cover the null/zero/no-prior cases. The literal gap from the issue was a test asserting the sign: seeds a creator with a price above its 24h-ago snapshot and asserts a positive priceChange24h, and one with a lower price asserting a negative value.
…rorg#612) Slow-query detection already existed in prisma.utils.ts (warn-level log with model/operation/fingerprint/elapsedMs, gated by the configurable SLOW_QUERY_THRESHOLD_MS env var, and never logging raw query parameters). Two real gaps against the issue's literal acceptance criteria: - The log used elapsedMs/model instead of the specified duration_ms/ table field names, and had no query_name or SQL-style operation (select/insert/update/delete) field. Added all four alongside the existing fields. - SLOW_QUERY_THRESHOLD_MS defaulted to 500ms; the issue specifies a 200ms default. Updated it (still overridable via env var).
|
@circleboyslimited Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
GET /creators/:id/holdersreturns them in descending order (10, 5, 3, 1), plus a single-holder scenario. The endpoint already sorts by balance descending by default (generically covered by the existingcreator-holders-sort.test.ts); this test locks in the exact scope from the issue (four specific quantities, exact expected order, single-holder case).src/modules/wallets/__tests__/wallet-holdings-default-sort.integration.test.tsalready seeds three holdings with distinct total values, calls the holdings endpoint with no sort param, and asserts highest-value-first / lowest-value-last ordering by total value (not balance or price alone), matching every acceptance criterion verbatim. No code or test change needed; noting this explicitly rather than adding a duplicate test.price_change_24hfield already exists on the creator detail response (creator-profile.service.ts, computed viacompute24hPriceChange), and existing tests already cover the null/zero/no-prior-snapshot cases. The literal gap was a test asserting the sign: added one that seeds a creator with a price above its 24h-ago snapshot (asserts positivepriceChange24h) and one with a lower price (asserts negative).prisma.utils.ts(warn-level log gated by the configurableSLOW_QUERY_THRESHOLD_MSenv var, never logging raw query parameters). Two real gaps against the issue's literal acceptance criteria: (1) the log usedelapsedMs/modelinstead of the specifiedduration_ms/tablefield names and had noquery_nameor SQL-styleoperation(select/insert/update/delete) field — added all four alongside the existing fields for backward compatibility; (2) the threshold defaulted to 500ms instead of the specified 200ms default — updated it (still overridable via env var).Closes #543
Closes #576
Closes #604
Closes #612
Test plan
npx tsc --noEmit— cleannpx eslinton all touched/added files — cleanconfig.test.ts,config.required.test.ts,config-mask.utils.test.ts,config-summary.utils.test.ts) — all passcreator-holders-quantity-sort.test.ts,creator-detail-price-change-sign.integration.test.ts) and the full existing integration suite require a live Postgres instance, which isn't available in this environment (no Docker, no local Postgres) — could not run them end-to-end. Confirmed viagit stashthat pre-existing test-suite failures (e.g.creators.slow-query-plan.test.ts) are unrelated to this change. Recommend runningpnpm db:up && pnpm testbefore merge.