Skip to content

fix: capture only real timeline entries in export scripts#85

Open
JinZhongcun wants to merge 1 commit into
viperrcrypto:mainfrom
JinZhongcun:fix/export-junk-entries
Open

fix: capture only real timeline entries in export scripts#85
JinZhongcun wants to merge 1 commit into
viperrcrypto:mainfrom
JinZhongcun:fix/export-junk-entries

Conversation

@JinZhongcun

Copy link
Copy Markdown

Summary

The bookmarklet and console export scripts hunt for any object shaped like a tweet (rest_id + legacy/core). User objects nested under core.user_results.result match that shape too, so they get captured as bookmarks with empty author/text/timestamp and are then imported into the database as empty entries. Quoted/embedded tweets can leak in the same way.

Changes

  • Capture tweets only from real timeline entries (entryId: "tweet-<id>", the format used by both the bookmarks and likes timelines) instead of pattern-matching arbitrary objects (BOOKMARKLET_SCRIPT and CONSOLE_SCRIPT in app/import/page.tsx)
  • isTweetObjisTweetEntry; the quoted_status_result skip is no longer needed since only entry containers are matched

Related Issues

None

Checklist

  • Tested locally — in a live export of ~2,000 bookmark items the old matcher produced 241 junk entries (~12% of the file); with entry-based capture the same scroll produced zero junk and no missed bookmarks
  • npx tsc --noEmit — no new errors introduced (the 2 pre-existing errors in app/api/import/x-oauth/fetch/route.ts are present on main as well)
  • No new warnings

The export scripts hunt for any object that looks like a tweet
(rest_id + legacy/core). User objects nested under
core.user_results.result also match that shape, so they get captured
as bookmarks with an empty author, text and timestamp, and are then
imported into the database as empty entries. Quoted/embedded tweets
from other timeline modules can leak in the same way.

Capture tweets only from real timeline entries (entryId "tweet-<id>",
used by both the bookmarks and likes timelines) instead of
pattern-matching arbitrary objects. In a live export of ~2,000
bookmark items, the old matcher produced 241 junk entries (~12%);
with entry-based capture, zero.
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