Skip to content

fix(contract-details) - fix state to avoid having the AI endpoint response getting resubmitted#1066

Merged
gabrielseco merged 4 commits into
mainfrom
PBYR-3914-contractors-AI-skippable
May 28, 2026
Merged

fix(contract-details) - fix state to avoid having the AI endpoint response getting resubmitted#1066
gabrielseco merged 4 commits into
mainfrom
PBYR-3914-contractors-AI-skippable

Conversation

@gabrielseco

@gabrielseco gabrielseco commented May 28, 2026

Copy link
Copy Markdown
Collaborator

Doing a quick fix to solve the issue at hand, we remove some hidden values from getting sent actually the problem is in the architecture we have some state not synced correctly when dealing with the forms

the hidden bugs are for the architecture, I'll explain them in a loom, we'll need to fix them someday

The loom is long as I am talking what are bugs in the architecture, we don't have a clear SSOT for the values state

https://www.loom.com/share/a38fcfaa0cf04ee4b6c690bc6ad375e3?focus_title=1&muted=1&from_recorder=1


Note

Low Risk
Targeted payload shaping on contract document creation with test coverage; no auth or broad architectural changes.

Overview
Contract details submissions no longer send client-only AI state on POST contract-documents: services_and_deliverables_ai_warning and services_and_deliverables_error_skippable are stripped from contract_document while skip_ai_checks still comes from fieldValues when the user may proceed after a skippable Remote AI error.

A regression test walks the flow through a skippable AI 422, forward to preview, back to contract details, and a third submit—asserting those two keys are absent from contract_document but skip_ai_checks stays true.

Reviewed by Cursor Bugbot for commit 148959d. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions

github-actions Bot commented May 28, 2026

Copy link
Copy Markdown
Contributor

📦 Bundle Size Report

Metric Current Previous Change Status
Total (gzip) 212.76 kB 212.74 kB +20 B (+0.0%) 🔴
Total (raw) 577.01 kB 576.92 kB +92 B (+0.0%) 🔴
CSS (gzip) 20.86 kB 20.86 kB 0 B (0%) 🟢
CSS (raw) 108.83 kB 108.83 kB 0 B (0%) 🟢

Size Limits

  • ✅ Total gzipped: 212.76 kB / 250 kB (85.1%)
  • ✅ Total raw: 577.01 kB / 600 kB (96.2%)
  • ✅ CSS gzipped: 20.86 kB / 25 kB (83.4%)

Largest Files (Top 5)

  1. chunk-UGPYPGVV.js - 14 kB (0 B (0%))
  2. styles.css - 10.43 kB (0 B (0%))
  3. index.css - 10.43 kB (0 B (0%))
  4. index.js - 6.13 kB (0 B (0%))
  5. chunk-ER46UFIU.js - 5.89 kB (0 B (0%))
View All Files (314 total)
File Size (gzip) Change
chunk-UGPYPGVV.js 14 kB 0 B (0%)
styles.css 10.43 kB 0 B (0%)
index.css 10.43 kB 0 B (0%)
index.js 6.13 kB 0 B (0%)
chunk-ER46UFIU.js 5.89 kB 0 B (0%)
chunk-B437XNYG.js 5.81 kB 0 B (0%)
chunk-EFL7QFFN.js 5.29 kB 0 B (0%)
chunk-AAGHUVZO.js 4.76 kB 0 B (0%)
chunk-XRQD4XM4.js 4.47 kB new
chunk-C5PA6MLW.js 4.06 kB 0 B (0%)

✅ Bundle size check passed

@github-actions

github-actions Bot commented May 28, 2026

Copy link
Copy Markdown
Contributor

📊 Coverage Report

⚪ Coverage unchanged

Metric Current Previous Change Status
Lines 90.08% 90.08% 0%
Statements 89.73% 89.73% 0%
Functions 87.67% 87.67% 0%
Branches 80.22% 80.22% 0%

Detailed Breakdown

Lines Coverage
  • Covered: 3724 / 4134
  • Coverage: 90.08%
  • Change: 0% (1 lines)
Statements Coverage
  • Covered: 3784 / 4217
  • Coverage: 89.73%
  • Change: 0% (1 statements)
Functions Coverage
  • Covered: 1010 / 1152
  • Coverage: 87.67%
  • Change: 0% (0 functions)
Branches Coverage
  • Covered: 2332 / 2907
  • Coverage: 80.22%
  • Change: 0% (0 branches)

✅ Coverage check passed

@github-actions

github-actions Bot commented May 28, 2026

Copy link
Copy Markdown
Contributor

Deploy preview for remote-flows ready!

Project:remote-flows
Status: ✅  Deploy successful!
Preview URL:https://remote-flows-i5hf4e0v9-remotecom.vercel.app
Latest Commit:148959d

Deployed with vercel-action

@gabrielseco gabrielseco self-assigned this May 28, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 4f4d43b. Configure here.

Comment thread src/flows/ContractorOnboarding/tests/ContractorOnboarding.test.tsx
@gabrielseco gabrielseco merged commit 5411738 into main May 28, 2026
10 checks passed
@gabrielseco gabrielseco deleted the PBYR-3914-contractors-AI-skippable branch May 28, 2026 16:25
jordividaller pushed a commit that referenced this pull request May 29, 2026
…ponse getting resubmitted (#1066)

* fix(contract-details) - fix state to avoid having the AI endpoint resubmitting

* fix parsed values

* add test

* fix
@cursor cursor Bot mentioned this pull request May 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants