Skip to content

replace fabricated verify page data with dynamic API response#153

Merged
ionfwsrijan merged 1 commit into
ionfwsrijan:mainfrom
lakshay122007:fix/151-dynamic-verify-page
Jun 22, 2026
Merged

replace fabricated verify page data with dynamic API response#153
ionfwsrijan merged 1 commit into
ionfwsrijan:mainfrom
lakshay122007:fix/151-dynamic-verify-page

Conversation

@lakshay122007

Copy link
Copy Markdown
Contributor

Before opening: make sure there is an issue tracking this work, and link it below. PRs without a linked issue may be closed without review.

Linked issue

Closes #151

What this PR does

This PR connects the Verify page to the backend /verify endpoint. It replaces the hardcoded, fabricated data arrays with dynamic React state that accurately reflects the actual sandbox execution results and timeline events. It also resolves a React key collision warning introduced by Strict Mode.

Type of change

  • Bug fix
  • New feature
  • ML model / training pipeline
  • Refactor (no behaviour change)
  • Documentation
  • Tests only

ML tier (if applicable)

  • Tier 1 — Triage
  • Tier 2 — Predictive
  • Tier 3 — Autonomous
  • Not ML-related

Stack affected

  • Backend
  • Frontend
  • Both

Changes

Backend

Frontend

  • frontend/src/app/pages/verify.tsx: Removed static verificationChecks and timeline arrays. Added a useEffect hook to call verify(jobId) via the API client and dynamically update the UI based on the sandbox response. Utilized crypto.randomUUID() to prevent React Strict Mode key duplication warnings.

New dependencies

Database / schema changes


Testing

How did you test this?

Tested locally by navigating to the Verify page after completing a scan. Verified that the loading state accurately appears while the backend processes the sandbox checks, and that the UI dynamically updates with the real success/failure results once the API call resolves. Checked the browser console to confirm the "two children with the same key" error is completely resolved.

Checklist

  • Tested locally end-to-end (upload ZIP or GitHub URL → scan → findings returned correctly)
  • New ML model falls back gracefully when model file is absent
  • No new console.error or unhandled Python exceptions introduced
  • Added or updated tests where applicable
  • requirements.txt / package.json updated if new dependencies added
  • New model files (.pkl, .pt, etc.) are gitignored, not committed

Anything reviewers should focus on

Take a look at the fallback logic inside the useEffect block in verify.tsx. If res.checks isn't explicitly returned as an array from the backend, the UI safely maps the top-level pass/fail status into a generic "Sandbox Verification Result" card to ensure the page doesn't crash.

Screenshots (if UI changed)

(The Verify page now displays a "Running" spinner during backend processing and dynamically turns red/green based on the actual sandbox output instead of showing static dummy data.)

Screenshot 2026-06-22 at 3 18 06 PM

@github-actions github-actions Bot added bug Something isn't working frontend Frontend issues SSoC26 labels Jun 22, 2026
@lakshay122007

Copy link
Copy Markdown
Contributor Author

hi @ionfwsrijan Please review it. Thanks!

@ionfwsrijan ionfwsrijan added the Easy Easy difficulty label Jun 22, 2026
@ionfwsrijan ionfwsrijan merged commit 011b33d into ionfwsrijan:main Jun 22, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working Easy Easy difficulty frontend Frontend issues SSoC26

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Verify Page Shows Hardcoded / Fabricated Data

2 participants