Repository navigation
fix(applications): prevent duplicate application submissions with in-flight coalescing and button locking - #96
Merged
Merged
Conversation
…y-load embeddings, and add runtime LLM fallback
…ght coalescing and button state
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
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.
Description
Resolves an issue where rapid or repeated submit clicks when creating a new job application resulted in multiple duplicate records with distinct IDs in the database.
This fix addresses both the frontend UI interaction layer and backend execution boundaries by implementing synchronous button locking, in-flight request coalescing, and database duplicate detection with idempotent
200 OKresponses.Changes
🎨 Tier 1: Frontend (React)
ApplicationsPage.jsx):{isAdding ? 'Adding...' : 'Save Application'}and markeddisabled={isAdding || !newAppForm.COMPANY || !newAppForm.ROLE_ID}.onSubmit(if (isAdding) return;).STAGE: ''alongside all form fields upon successful creation.useApplications.js):isAddingRef = useRef(false)lock insideaddApplicationto intercept rapid synchronous clicks within the same event loop tick before React re-renders.isAdding: addApplicationMutation.isPending.⚙️ Tier 2: Primary Backend (Node.js / Express)
applications.controller.js):${userId}:${company}:${roleId}:${date}.applications.service.js):inFlightCreations) and normalized application dates to the calendar day (YYYY-MM-DD, ignoring hours/time components).200 OK(tagged_wasDeduplicated: true) without creating orphan history entries.