npm run typecheckExpected Result: No errors What it validates:
- All TypeScript types are correct
ApiConflictErrorproperly extends ErrorWithRevision<T>generic type works correctly- Hook return types match usage
- Component props align with implementations
npm run lintExpected Result: No errors (may have warnings for unused variables) What it validates:
- Code follows ESLint rules
- No unused imports
- Proper formatting
- No console logs left behind (except intentional logging)
npm run buildExpected Result: Build succeeds What it validates:
- All code compiles to JavaScript
- No runtime errors in type inference
- All imports resolve correctly
- CSS/styling loads properly
npm run test -- \
--testPathPattern="conflict|revision-tracking" \
--runExpected Result: All tests pass Tests included:
- ResolveConflictDialog component tests
- useConflictResolution hook tests
- Organization list conflict tests
- Issuer list conflict tests
- Revision tracking utility tests
npm run test -- \
components/forms \
components/organizations \
components/issuers \
hooks \
lib/api \
--runExpected Result: All tests pass, no regressions Coverage targets:
- Component rendering and UI interaction
- Hook state management
- API layer with revision tracking
- Error handling and edge cases
npm run test -- \
--testPathPattern="conflict|revision-tracking" \
--coverage \
--runExpected Result: Coverage above 80% for new code Metrics:
- Statements: ≥80%
- Branches: ≥75%
- Functions: ≥80%
- Lines: ≥80%
- Navigate to
/settings/organizations - Open browser DevTools Network tab
- Modify organization status
- Simulate server change (manually edit response in DevTools)
- Verify: Conflict dialog appears with server vs. local values
- Actions to test:
- Click "Keep Editing" → dialog closes, form unchanged
- Click "Reload from Server" → fresh data loads
- Click "Retry with My Changes" → submission retries with local values
- Navigate to
/settings/issuers - Repeat organization flow steps with issuer
- Verify: Dialog shows issuer-specific fields
- Verify: Organization relationship is preserved
- Test with different user roles (ADMIN, ISSUER, WORKER)
- Verify: Only authorized users see management UI
- Verify: Conflict dialog respects field visibility
- Verify: Read-only users don't see edit affordances
- Navigate dialogs with keyboard only (Tab, Shift+Tab, Enter, Escape)
- Verify: Focus management works correctly
- Verify: Escape key closes conflict dialog
- Verify: Screen reader announces conflict title and field changes
- Verify: Color contrast is sufficient for conflicting field warnings
Test in:
- Chrome/Edge (latest)
- Firefox (latest)
- Safari (latest)
- Mobile browsers (iOS Safari, Chrome Mobile)
Verify: Dialog renders and functions correctly on all browsers
# Conflicts won't occur yet, but infrastructure is in place
npm run test -- --testPathPattern="conflict" --runExpected: Tests pass, showing conflict detection works when backend is ready
- Update backend to send 409 on revision mismatch
- Include
currentEntityin response body - Verify: Frontend detects conflict correctly
- Verify: Dialog displays correct server vs. local comparison
- Verify: Retry submissions include new revision
Verify the backend sends proper 409 responses:
{
"statusCode": 409,
"code": "CONFLICT",
"message": "Resource was modified after you loaded this form",
"currentEntity": {
"id": "org-123",
"name": "Updated Name",
"status": "SUSPENDED"
},
"submittedData": {
"status": "ACTIVE"
}
}- Create new organization → Verify: Works as before
- Update organization details → Verify: Submission succeeds without conflict
- Update organization status → Verify: Status changes, no dialog appears
- Create and manage issuers → Verify: No regressions
- Navigation and routing → Verify: Settings pages load correctly
- Simulate network error → Verify: Error toast shows (existing behavior)
- Simulate 401 Unauthorized → Verify: Auth error handling works
- Simulate 403 Forbidden → Verify: Permission error shows correctly
- Simulate 500 Server Error → Verify: Generic error message shown
- Navigate to organization management page
- Open DevTools Performance tab
- Check time to interactive
- Verify: No noticeable slowdown from revision tracking
- Open organization management page
- Perform multiple updates
- Open DevTools Memory profiler
- Verify: No memory leaks from dialog/hook lifecycle
npm run build
# Check dist/static/js/ folder sizeExpected: Minimal increase (new components/hook should add <20KB gzipped)
-
STALE_WRITE_CONFLICT_PR_SUMMARY.mdaccurately describes implementation -
CONFLICT_HANDLING_GUIDE.mdprovides clear integration template - Code comments explain complex logic (hash creation, conflict comparison)
- TypeScript JSDoc comments on public APIs
- All TypeScript checks pass (
npm run typecheck) - All linting passes (
npm run lint) - Build succeeds (
npm run build) - All unit tests pass (
npm run test -- --run) - Conflict handling tests specifically validated
- Manual feature testing completed
- No console errors or warnings
- Accessibility testing passed
- Browser compatibility verified
- Regression tests confirm no breakage
- Performance acceptable
- Documentation complete and accurate
- PR description includes validation output
- Deploy to staging environment
- Run end-to-end tests
- Monitor error logs for unexpected issues
- Check performance metrics (page load, interaction times)
- Verify in production-like environment
- Revision tracking uses JSON hash (will upgrade to ETags when backend ready)
- TrustedSource forms not yet implemented (template provided in guide)
- Merge strategies not yet supported (only overwrite or reload options)
- No conflict analytics (can be added later)
- Reviewed by: [Code Reviewer]
- Date: [Date]
- Build Status: ✓ Passing
- Test Status: ✓ All tests passing
- Ready for merge: ✓ Yes