Repository navigation
Fix Fayda FAN false positive on adjacent date-of-birth dates - #1869
Open
BurningAXE wants to merge 1 commit into
Open
BurningAXE wants to merge 1 commit into
BurningAXE wants to merge 1 commit into
Conversation
5 tasks
BurningAXE
force-pushed
the
bugfix/fayda-fan-date-false-positive
branch
from
October 19, 2026 21:54
c11f840 to
ff4050e
Compare
BurningAXE
marked this pull request as ready for review
October 20, 2026 11:00
BurningAXE
requested review from
a team,
TristramN,
alex-vt,
alexandr-simprints,
luhmirin-s,
meladRaouf and
ybourgery
and
a balanced review from Copilot
and removed request for
a team
October 20, 2026 11:00
There was a problem hiding this comment.
🟢 Approved
The focused matching change and regression coverage have no identified blocking issues; tests were inspected but not executed.
No open issues 🎉
What changed in this PR
Fixes Fayda OCR incorrectly accepting adjacent birth dates as a FAN, addressing a regression introduced with Fayda support.
Changes:
- Restricts OCR matching to 16 digits across at most four whitespace-separated groups.
- Extracts FANs from surrounding text while preserving manual validation.
- Adds regression tests for date lines and accepted/rejected formats.
| File | Description |
|---|---|
| feature/external-credential/src/test/java/com/simprints/feature/externalcredential/screens/scanocr/usecase/FaydaCardOcrReaderUseCaseTest.kt | Adds FAN extraction and date-rejection regression tests. |
| feature/external-credential/src/main/java/com/simprints/feature/externalcredential/screens/scanocr/usecase/FaydaCardOcrReaderUseCase.kt | Replaces digit stripping with constrained OCR matching. |
Review effort: Balanced
meladRaouf
approved these changes
Oct 20, 2026
Collaborator
|
@BurningAXE Please change the target branch to 2026.3.1 I have created it. |
BurningAXE
added this pull request to stack #1873
October 20, 2026 11:03
BurningAXE
removed this pull request from stack #1873
October 20, 2026 11:19
BurningAXE
added this pull request to stack #1874
October 20, 2026 11:22
luhmirin-s
approved these changes
Oct 20, 2026
| "1234567812345A78", // letter in the middle | ||
| "1234-5678-1234-5678", // punctuation between digits | ||
| "1234.5678.1234.5678", // punctuation between digits | ||
| "1234 5678 1234 5678", // more than one whitespace between digits |
Contributor
There was a problem hiding this comment.
Could this be a realistic case from OCR? Maybe not all double spaces, but one of them could be.
The FAN reader stripped all non-digits from an OCR line before matching 16 digits, so the date-of-birth line "07/02/1998 | 2005/10/17" was read as FAN 0702199820051017. Match 16 digits (optionally whitespace-separated) within the line instead, rejecting punctuation between digits and longer digit runs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
BurningAXE
force-pushed
the
bugfix/fayda-fan-date-false-positive
branch
from
October 20, 2026 11:51
ff4050e to
3b87b16
Compare
|
This branch has not been 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.




JIRA ticket
Will be released in: 2026.3.1
Root cause analysis (for bugfixes only)
First known affected version: 2026.3.0 (Fayda support added in #1748)
0702 1998 2005 1017for a card whose date-of-birth line reads07/02/1998 | 2005/10/17(Gregorian | Ethiopian).FaydaCardOcrReaderUseCasestripped all non-digit characters from each OCR line and then matched^\d{16}$. The date-of-birth line contains exactly 16 digits once the/and|separators are removed, so it was accepted as a FAN.2512200020080831from25/12/2000 | 2008/08/31in 6 of 8 frames.Notable changes
FAN_OCR_PATTERN, which looks for 16 digits within an OCR line, and not part of a longer digit run. OCR sometimes splits the number, so up to 4 groups separated by single whitespace characters are allowed (e.g.258094592481 5610). Date lines can't match: punctuation between digits isn't accepted, and the 6 groups of a date line whose separators OCR read as spaces (07 02 1998 2005 10 17) exceed the 4-group limit.FAN 8642370540168134) is tolerated.FAN_PATTERN(^\d{16}$) is unchanged. It is still used to validate manually entered or edited FANs inExternalCredentialSearchViewModel.1234-5678-1234-5678or1234.5678.1234.5678are no longer accepted by OCR. The card prints the FAN as one unbroken 16-digit number, so this was a false-positive risk rather than a supported format.Testing guidance
FaydaCardOcrReaderUseCaseTestcover both reported date-of-birth lines, date lines with the|lost or the separators read as spaces by OCR, the FAN appearing below date lines, extra text on the FAN line, and rejected separators.Additional work checklist
🤖 Generated with Claude Code