Skip to content

Conversation

@Process-ing
Copy link
Contributor

@Process-ing Process-ing commented Dec 27, 2025

Description

Closes #515. Modifies PreviewRequestForm to, when receiving a duplicate request, allow the user to retry submitting the request by asking the server to replace the old one. The currently implemented flow is the following:

  1. The user submits a request to the backend
  2. The server detects a duplicate hash, returning the error
  3. The form changes, and the user is allowed to resubmit the request with replace: true
  4. With the new flag, the server cancels the previous requests and creates the new one

See also this PR for the backend.

Important

When testing this branch, don't forget to also checkout the backend to the branch feature/confirmation-popup

Request form when a duplicate is detected

Changes Made

  • Modified PreviewRequestForm to show new view when receives a duplicate-request error from the server
  • On new form view, resubmit the request with replace: true
  • Made some fixes/improvements to the form overall

@netlify
Copy link

netlify bot commented Dec 27, 2025

Deploy Preview for tts-fe-preview ready!

Name Link
🔨 Latest commit 1056a26
🔍 Latest deploy log https://app.netlify.com/projects/tts-fe-preview/deploys/695178e461d2b100089183de
😎 Deploy Preview https://deploy-preview-596--tts-fe-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@Process-ing Process-ing marked this pull request as ready for review December 28, 2025 17:48
@Process-ing Process-ing requested a review from Copilot December 28, 2025 17:48
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 implements a request substitution confirmation flow that detects duplicate exchange requests and allows users to replace existing requests with new ones. When the backend returns a duplicate error, the form displays a warning message and changes the submit button to explicitly indicate that submitting will cancel the previous request.

Key Changes:

  • Added duplicate request detection and handling with hasDuplicate state flag
  • Modified submission flow to include a replace parameter when resubmitting after duplicate detection
  • Updated UI to show appropriate warnings and button text when duplicates are detected

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

File Description
PreviewRequestForm.tsx Added duplicate detection logic, state management for hasDuplicate, and conditional alert display for duplicate warnings
ExchangeSubmissionConfirmation.tsx Updated submit button to show context-specific text and icon based on whether a duplicate exists, added hasDuplicate prop
exchangeRequestService.ts Added replace parameter to submitExchangeRequest function and included it in FormData when true
.env.example Removed placeholder character from APP_SENTRY_AUTH_TOKEN

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Process-ing Process-ing requested a review from a team December 28, 2025 18:39
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.

Confirmation Popup

3 participants