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

Cannot read property 'match' of undefined #8

Closed
bkeepers opened this issue Aug 7, 2017 · 2 comments · Fixed by #16 · May be fixed by #10
Closed

Cannot read property 'match' of undefined #8

bkeepers opened this issue Aug 7, 2017 · 2 comments · Fixed by #16 · May be fixed by #10

Comments

@bkeepers
Copy link
Contributor

bkeepers commented Aug 7, 2017

I'm seeing this error every 5 minutes:

TypeError: Cannot read property 'match' of undefined
   at Object.propFromComment (/app/lib/format-parser.js:20:31)
   at Freeze.unfreezable (/app/lib/freeze.js:21:32)
   at github.issues.getComments.then.then.lastFreezeComment (/app/index.js:53:22)
   at process._tickDomainCallback (internal/process/next_tick.js:135:7)
@jbjonesjr
Copy link
Owner

Interesting. I do a query on the repo to see if there are any "frozen" issues that need to be thawed. I bet i don't handle the there are no issues frozen case.

@jbjonesjr
Copy link
Owner

Writing out loud:

  • The fact that you made it to index.js:53 says that you queried the repo for "snoozed" issues, and got at least one returned.
  • It then queries to get the comments for that issue. (...getComments).
  • The second .then assumes to be passed the comment for the last time you made a snooze request (in case you made multiple requests, we only care about the most recent one).

What happens if that assumption is not met? You'd instead be passed an empty {}, which comment.body would be undefined, which then means calling .match on undefined gives you your error.

So what could be causing this?

Well, two options:

  • The comment body is somehow malformed and I can't get the last snooze command even though you issued one. This is a corrupted record in terms of snooze's ability to read it. Figure out why I corrupted it, and how I should be more flexible in my reading.
  • It's a really long thread. Too big issue threads fail #2 reminds me that I don't yet handle pagination. If it is a 100+ comment issue, and you snoozed it in the 2nd page of comments, I won't iterate/find it, and could create this situation.

@bkeepers , any chance you have a hunch on what repo/issue this is being caught up on?

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 a pull request may close this issue.

2 participants