Skip to content

Skip non-Messenger JSONs in get_fb_messages instead of crashing - #412

Merged
abrignoni merged 1 commit into
mainfrom
fix/fb-messages-foreign-json
Aug 11, 2026
Merged

Skip non-Messenger JSONs in get_fb_messages instead of crashing#412
abrignoni merged 1 commit into
mainfrom
fix/fb-messages-foreign-json

Conversation

@abrignoni

Copy link
Copy Markdown
Owner

get_fb_messages globs /.json, so in any return package it matches every JSON and then assumed the Messenger export shape. On a Google Takeout the first foreign JSON killed the artifact: a top-level list raised AttributeError on .get, and a dict without participants raised TypeError on participants[0].

Guard the shape: skip files that fail to parse, are not a dict, or lack a non-empty participants list and a messages list. A real Messenger-shaped export still parses (round-trip validated, 2 messages with conversation columns intact; shape-verified rather than corpus-verified since no registered corpus carries a Messenger E2E export yet). A full RLEAPP run over a 2021 Google Takeout goes from an artifact-killing traceback to zero error lines, with the correct empty result for Facebook Messenger.

🤖 Generated with Claude Code

The artifact's glob is */*.json, so in any return package it matches every
JSON file, then assumed the Facebook Messenger export shape. On a Google
Takeout the first foreign JSON killed the whole artifact: a top-level list
raised AttributeError on .get, and a dict without a participants list raised
TypeError on participants[0]. Found sweeping a newly registered 2021 Google
Takeout corpus.

Guard the shape instead: skip files that fail to parse as JSON, are not a
dict, or lack a non-empty participants list and a messages list. Real
Messenger exports parse unchanged (validated with a Messenger-shaped export
round-trip: 2 messages, conversation columns intact - shape-verified, not
corpus-verified, since no registered corpus carries a Messenger E2E export
yet). The full Takeout sweep goes from an artifact-killing traceback to a
clean run with zero error lines.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@abrignoni
abrignoni merged commit 18a955f into main Aug 11, 2026
8 checks passed
@abrignoni
abrignoni deleted the fix/fb-messages-foreign-json branch August 11, 2026 19:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant