Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught undefined in tweet splitter #174

Open
QuinnyPig opened this issue Feb 26, 2024 · 2 comments
Open

Uncaught undefined in tweet splitter #174

QuinnyPig opened this issue Feb 26, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@QuinnyPig
Copy link
Contributor

This was working fine until a few days ago, then it started throwing this trace; any tips on how to figure out what it's choking on / get it to handle the failure gracefully?

│ content-mapper ✔ tweets: total: 14 retweets: 0 replies: 0 quotes: 0 │
│ content-mapper ✔ task finished │
│ TypeError: Cannot read properties of undefined (reading 'matchAll') │
│ at file:///app/dist/helpers/tweet/split-tweet-text/extract-words-and-spacers.js:36:34 │
│ at Array.forEach () │
│ at extractWordsAndSpacers (file:///app/dist/helpers/tweet/split-tweet-text/extract-words-and-spacers.js:35:13) │
│ at splitTweetText (file:///app/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:///app/dist/helpers/post/make-bluesky-post.js:40:17) │
│ at async makePost (file:///app/dist/helpers/post/make-post.js:29:23) │
│ at async postsSynchronizerService (file:///app/dist/services/posts-synchronizer.service.js:26:70) │
│ at async touitomamout (file:///app/dist/index.js:21:31) │
│ at async file:///app/dist/index.js:33:1 │

@QuinnyPig QuinnyPig added the bug Something isn't working label Feb 26, 2024
@QuinnyPig
Copy link
Contributor Author

A few console.log statements later, and it looks to be a missing catch around an error thrown when a tweet has two links in it. Deleted the tweet and the error stopped.

@QuinnyPig
Copy link
Contributor Author

QuinnyPig commented Feb 27, 2024

I've deleted the tweet, but the newentries object here was:

  {
    str: 'Volkswagen got caught cheating on emissions tests.\n' +
      '\n' +
      'Obviously, someone then created Volkswagen (a CI/CD tool that always passes if in a CI environment). ',
    sep: ''
  },
  { str: 'https://github.com/auchenberg/volkswagen', sep: ' ' },
  {
    str: '\n' +
      '\n' +
      'Then Volkswagen ACTUALLY DID A CI/CD JOINT VENTURE https://www.volkswagen-newsroom.com/en/press-releases/volkswagen-and-tracetronic-establish-neocx-a-joint-venture-for-automated-software-integration-7378',
    sep: ''
  },
  { str: '', sep: '' },
  {
    str: 'https://www.volkswagen-newsroom.com/en/press-releases/volkswagen-and-tracetronic-establish-neocx-a-joint-venture-for-automated-software-integration-7378',
    sep: ''
  },
  { str: undefined, sep: '' }
]

The undefined caused it to choke.

@QuinnyPig QuinnyPig changed the title Getting debug data Uncaught undefined in tweet splitter Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant