You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
FEC filings can contain [BEGINTEXT]/[ENDTEXT] blocks for miscellaneous text records (F99 form type). FastFEC captures this text content and includes it in the text column of F99.csv. libfec's fastfec subcommand outputs an empty text field.
The parser (Filing::next_row() in lib.rs:344-382) does read and accumulate the text content into a contents variable, but this content is discarded - the method returns the record that follows [ENDTEXT] without attaching the text.
Affected Filing
Filing ID: 1938291 (159 bytes, DIONE SIMS FOR CONGRESS F99 filing)
Also: 1944545 (168 bytes), 1943137 (186 bytes)
# Compare the F99.csv files:
diff /tmp/out_libfec/1938291/F99.csv /tmp/out_fastfec/1938291/F99.csv
# 2c2,3# < F99,C00930974,...,20260130,MST,,# ---# > F99,C00930974,...,2026-01-30,MST,,"# > "# libfec text field is empty:
awk -F, '{print NR": text="$NF}' /tmp/out_libfec/1938291/F99.csv
# 1: text=text# 2: text=# FastFEC text field has content (newline in this case):
awk -F, '{print NR": text="$NF}' /tmp/out_fastfec/1938291/F99.csv
# 1: text=text# 2: text="# 3: "
Root Cause
In fec-parser/src/lib.rs:344-382, the [BEGINTEXT] handler accumulates text into contents:
if row_type == "[BEGINTEXT]"{letmut contents = String::new();loop{// ... accumulates text lines into `contents` ...Some(b"[ENDTEXT]") => matchself.records_iter.next(){// Returns the NEXT record after [ENDTEXT], discarding `contents`
return Some(Ok(FilingRow{ row_type, record, original_size }));}}}
The contents string is built up but never passed to the returned FilingRow.
Suggested Fix
Add the text content to FilingRow (perhaps as an Option<String> field), and in fastfec.rs, append it to the record before writing when present.
Note
Much of this ticket was composed with Claude
FEC filings can contain
[BEGINTEXT]/[ENDTEXT]blocks for miscellaneous text records (F99 form type). FastFEC captures this text content and includes it in thetextcolumn ofF99.csv. libfec's fastfec subcommand outputs an emptytextfield.The parser (
Filing::next_row()inlib.rs:344-382) does read and accumulate the text content into acontentsvariable, but this content is discarded - the method returns the record that follows[ENDTEXT]without attaching the text.Affected Filing
Filing ID: 1938291 (159 bytes, DIONE SIMS FOR CONGRESS F99 filing)
Also: 1944545 (168 bytes), 1943137 (186 bytes)
Reproduction
Observe the Difference
Root Cause
In
fec-parser/src/lib.rs:344-382, the[BEGINTEXT]handler accumulates text intocontents:The
contentsstring is built up but never passed to the returnedFilingRow.Suggested Fix
Add the text content to
FilingRow(perhaps as anOption<String>field), and infastfec.rs, append it to the record before writing when present.