-
Notifications
You must be signed in to change notification settings - Fork 28
Open
Description
Bug: CSV Export Truncates Birth Years (1986 β 86)
π Summary
CSV export truncates 4-digit birth years to 2-digit using modulo 100 operation, causing data loss and century ambiguity.
Example: Runner born in 1986 exports as "86" in CSV
π Bug Location
File: code/oImportExport.cpp
Line: 176
π Current Code (Broken)
row[OEbirth] = conv_is(di.getInt("BirthYear") % 100);β Proposed Fix
row[OEbirth] = conv_is(di.getInt("BirthYear"));Change: Simply remove the % 100 modulo operation.
π§ͺ Test Case
- Create runner with birth year 1986
- Export to CSV
- Current Result: CSV shows
86 - Expected Result: CSV shows
1986
π₯ Impact
- Data Loss: Century information is permanently lost in CSV exports
- Ambiguity: Cannot distinguish between 1986 and 2086 (both become "86")
- Import Problems: Other systems receiving the CSV cannot reliably determine actual birth years
- Age Calculations: Incorrect age calculations due to missing century
π Real-World Examples
- Runner born 1975 β exports as
75(could be 1975 or 2075) - Runner born 2008 β exports as
8(could be 1908, 2008, or 2108) - Runner born 1999 β exports as
99(could be 1899, 1999, or 2099)
π― Why This Fix is Safe
- Backward Compatible: Systems expecting 4-digit years will work correctly
- Forward Compatible: Future years beyond 2099 will export properly
- Data Preservation: No information is lost
- One Line Change: Minimal risk of introducing new bugs
β‘ Priority: HIGH
This is a simple one-line fix that resolves significant data loss. The fix is:
- β Easy to implement
- β Low risk
- β High impact
- β Affects all CSV exports
π Files to Change
code/oImportExport.cpp(Line 176 only)
Bug discovered through practical orienteering event management and confirmed via source code analysis.
Metadata
Metadata
Assignees
Labels
No labels