louisgrasset / touitomamout

Touitomamout is an easy way to synchronize your Twitter's tweets 🦀 to Mastodon 🦣 and Bluesky post ☁️ (also known as Twitter to Mastodon & Bluesky crossposter)
https://hub.docker.com/r/louisgrasset/touitomamout
GNU Affero General Public License v3.0
194 stars 10 forks source link

Garbage in tweet cause the sync to stop working #195

Open jeffmaury opened 2 months ago

jeffmaury commented 2 months ago

Describe the bug A tweet causes the sync to stop working anymore

🦣 client       √ connected
☁️ client       √ connected
profile-sync    √ task finished
content-mapper  √ tweets: total: 1 retweets: 0 replies: 0 quotes: 0
content-mapper  √ task finished
content-sync    / post: β†’ generating β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ 100% Β« We are hiring: SE (https:... Β»TypeError: Cannot read properties of undefined (reading 'matchAll')
    at file:///C:/Users/Jeff/work/src/github.com/louisgrasset/touitomamout/dist/helpers/tweet/split-tweet-text/extract-words-and-spacers.js:36:34
    at Array.forEach (<anonymous>)
    at extractWordsAndSpacers (file:///C:/Users/Jeff/work/src/github.com/louisgrasset/touitomamout/dist/helpers/tweet/split-tweet-text/extract-words-and-spacers.js:35:13)
    at splitTweetText (file:///C:/Users/Jeff/work/src/github.com/louisgrasset/touitomamout/dist/helpers/tweet/split-tweet-text/split-tweet-text.js:23:21)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async makeBlueskyPost (file:///C:/Users/Jeff/work/src/github.com/louisgrasset/touitomamout/dist/helpers/post/make-bluesky-post.js:40:17)
    at async makePost (file:///C:/Users/Jeff/work/src/github.com/louisgrasset/touitomamout/dist/helpers/post/make-post.js:29:23)
    at async postsSynchronizerService (file:///C:/Users/Jeff/work/src/github.com/louisgrasset/touitomamout/dist/services/posts-synchronizer.service.js:26:70)
    at async touitomamout (file:///C:/Users/Jeff/work/src/github.com/louisgrasset/touitomamout/dist/index.js:21:31)
    at async file:///C:/Users/Jeff/work/src/github.com/louisgrasset/touitomamout/dist/index.js:33:1

To Reproduce The tweet causing the issue: https://x.com/jeffmaury/status/1829184894372884970

Expected behavior An error message about parsing error and continue syncing

Screenshots N/A

Additional supporting information Windows11 Pro laptop Using ce672e891499d907fa9da0d704b4987dd6323145

trfetzer commented 2 months ago

Have you found a way to fix this without all the content being reposted?

jeffmaury commented 2 months ago

Have you found a way to fix this without all the content being reposted?

I made a local patch but was not sure about the code so did not submit a PR. Maybe look at #201

trfetzer commented 1 month ago

No I tried to fix it but, well to cut a long story short it didnt work. Did you have a clever or quick way of even identifying the tweet that had the character? Just so that one can avoid using potentially problematic characters.

louisgrasset commented 1 month ago

Hello, I've been investigating this. I'm not able to actually reproduce it with the given tweet. Though, I've been able to identify potentially error prone case, so I made a fix for it. Let me know if the issue persist

trfetzer commented 1 month ago

The error still seems to happen unfortunately. It is incredibly strange as I can not identify which posts are triggering this either. @jeffmaury how have you come along on this?

2024-10-09 19:27:21 TypeError: Cannot read properties of undefined (reading 'matchAll') 2024-10-09 19:27:21 at file:///app/dist/index.js:11546:21 2024-10-09 19:27:21 at Array.forEach () 2024-10-09 19:27:21 at gl (file:///app/dist/index.js:11545:12) 2024-10-09 19:27:21 at Ki (file:///app/dist/index.js:11581:13) 2024-10-09 19:27:21 at async Il (file:///app/dist/index.js:11619:13) 2024-10-09 19:27:21 at async Ol (file:///app/dist/index.js:11652:13) 2024-10-09 19:27:21 at async Gl (file:///app/dist/index.js:11747:40) 2024-10-09 19:27:21 at async vi (file:///app/dist/index.js:11976:13) 2024-10-09 19:27:21 at async Timeout._onTimeout (file:///app/dist/index.js:11992:5)

jeffmaury commented 1 month ago

A tweet with several links

trfetzer commented 1 month ago

thanks, would make sense to reopen this potentially @louisgrasset , it has been quite erratic behavior.

louisgrasset commented 1 month ago

By the way, the potential fix is only on dev tag (just in case you did not tested it)