Skip to content

Address code review feedback from PR #28#29

Merged
Steake merged 3 commits intoclaude/identify-next-steps-011CUkvaedPA7QhrXGbbj54gfrom
copilot/sub-pr-28
Feb 23, 2026
Merged

Address code review feedback from PR #28#29
Steake merged 3 commits intoclaude/identify-next-steps-011CUkvaedPA7QhrXGbbj54gfrom
copilot/sub-pr-28

Conversation

Copy link
Contributor

Copilot AI commented Nov 7, 2025

Addresses all review comments from PR #28 covering mock data generation, test reliability, and build optimization.

Mock hash generation

  • Use crypto.randomBytes(32) instead of Math.random() to avoid potential leading zeros in hex strings
  • Remove unused destructured variables (priority, userId, circuitType)
// Before
hash: `0x${Array.from({ length: 32 }, () => Math.floor(Math.random() * 16).toString(16)).join('')}`

// After  
hash: `0x${crypto.randomBytes(32).toString('hex')}`

E2E test reliability

  • Move page.on("pageerror") before page.goto() to capture errors during page load
  • Replace arbitrary waitForTimeout() delays with condition-based waitForSelector("h1")

Playwright build optimization

  • Extract web server command to helper function for clarity
  • Conditionally skip build in CI where it runs separately in workflow
  • Reduce timeout from 180s to 120s (build no longer included)
const getWebServerCommand = () =>
  process.env.CI ? "npm run preview" : "npm run build && npm run preview";

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits November 7, 2025 16:48
Co-authored-by: Steake <530040+Steake@users.noreply.github.com>
Co-authored-by: Steake <530040+Steake@users.noreply.github.com>
Copilot AI changed the title [WIP] Improve zkML circuit tooling and test reliability Address code review feedback from PR #28 Nov 7, 2025
Copilot AI requested a review from Steake November 7, 2025 16:53
@Steake Steake marked this pull request as ready for review February 23, 2026 04:22
Copilot AI review requested due to automatic review settings February 23, 2026 04:23
@Steake Steake merged commit 507146d into claude/identify-next-steps-011CUkvaedPA7QhrXGbbj54g Feb 23, 2026
2 checks passed
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses follow-up review feedback from PR #28 by tightening mock data generation, improving Playwright E2E reliability, and cleaning up related configuration/documentation in the SvelteKit dApp and its mock backend.

Changes:

  • Switch mock proof hash generation to crypto.randomBytes(32) and remove unused request-body fields in the mock server.
  • Improve Playwright smoke test reliability by capturing pageerror before navigation and replacing fixed delays with selector-based waits.
  • Refactor Playwright webServer.command selection for CI vs local runs and reduce startup timeout.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/unit/mock-api-consistency.test.ts Normalizes formatting/quoting for the mock API consistency unit test.
tests/e2e/smoke.test.ts Captures page errors earlier and replaces arbitrary sleeps with an h1-based readiness check.
src/routes/+layout.svelte Removes an extra blank line (formatting cleanup).
src/lib/web3/onboard.ts Formats the @web3-onboard/core import and makes the primary chain selection logic clearer.
src/hooks.client.js Normalizes quoting and adds a trailing comma in the returned error object.
server/index.ts Uses crypto.randomBytes for stable-length mock hashes and removes unused destructured fields.
playwright.config.ts Extracts web server command selection and changes web server timeout to 120s.
documentation/vision-delivery-blueprint.md Markdown spacing/formatting adjustments.
SVELTE_E2E_FIX_REPORT.md Markdown spacing/formatting adjustments.
NEXT_STEPS_IMPLEMENTATION_PLAN.md Markdown spacing/formatting adjustments.
IMPLEMENTATION_FIXES_REPORT.md Markdown spacing/formatting adjustments (tables/headings).
E2E_ROOT_CAUSE_ANALYSIS.md Markdown spacing/formatting adjustments (tables/sections).
CIRCUIT_GENERATION_GUIDE.md Markdown spacing/formatting adjustments (tables/sections).
BACKEND_E2E_FIXES_REPORT.md Markdown spacing/formatting adjustments (tables/sections).
Comments suppressed due to low confidence (1)

tests/e2e/smoke.test.ts:38

  • This test collects pageerrors but only logs a warning when errors are detected; it never fails the test. That allows runtime exceptions during page load to slip through CI as passing tests. Consider asserting that errors is empty (or filtering/allowlisting known non-critical errors and failing on the rest) once the page is considered initialized.
    // Wait for main heading to appear, indicating JS initialization
    await page.waitForSelector("h1", { timeout: 5000 });

    if (errors.length > 0) {
      console.warn("⚠ Console errors detected:", errors);
    } else {
      console.log("✓ No critical page errors detected");

Comment on lines 59 to 64
webServer: {
command: "npm run build && npm run preview",
command: getWebServerCommand(),
url: "http://localhost:4173",
reuseExistingServer: !process.env.CI,
timeout: 180000, // 3 minutes for build + preview
timeout: 120000, // 2 minutes for preview server startup
},
Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

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

webServer.timeout was reduced to 120s, but in non-CI runs command still includes npm run build && npm run preview, so the timeout still needs to cover the build time as well. This can cause local/PR runs (where CI is unset) to flake if builds take >2 minutes. Consider making the timeout conditional (longer when the build is part of the command) or splitting build/preview so the timeout meaning stays consistent with the comment.

Copilot uses AI. Check for mistakes.
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.

3 participants