CodeTriage icon indicating copy to clipboard operation
CodeTriage copied to clipboard

Receiving issue that is already closed

Open sngeth opened this issue 7 years ago • 15 comments

Is the intended behavior to receive issues that are closed or was this a 1 off error?

Hello @sngeth,

Here are some issues you should check out:

#17104 Fix numericality validation with large numbers

rails/rails about 1 year ago

sngeth avatar Jan 19 '17 19:01 sngeth

Sorry, I just noticed this was a Pull Request item not an Issue

sngeth avatar Jan 20 '17 14:01 sngeth

@sngeth Still we can change our code to not send such PR which is already closed, want to send a PR? 😉

prathamesh-sonpatki avatar Jan 20 '17 16:01 prathamesh-sonpatki

There is a race condition in sending out emails. We only import from GitHub once a day and the issue may have been closed between when we import and when we send out the email. Maybe the best way to check would be before we send out an email for an issue, we see if it's been updated within the last say 30 minutes. Otherwise we would be adding N API calls to github where N is the number of users times the number of issues they've subscribed to.

schneems avatar Jan 20 '17 16:01 schneems

Hey I am interested in adding this improvement although i'm not sure if i'm clear on your suggested strategy.

Are you saying we should repopulate our entire Issues model before SendDailyTriageEmailJob#perform gets fired thus keeping things O(n) where n = issues.

Is there a specific way to determine which are the "pertintent issues" that needs to be taken account without tying it to # of users or subscriptions....or just do it wholesale?

I also noticed that User#send_daily_triage! calls IssueAssigner#assign which calls Issue#valid_for_user? which calls Issue#update_issue! which refetches the issue. Unless i'm reading something wrong, does this not solve the issue of stale statuses?

def valid_for_user?(user, skip_update = Rails.env.test?)
  unless skip_update
    update_issue!
    ...
  end
  ...
end 

It looks like it's already doing the original N * Users * Issues ?

sngeth avatar Jan 24 '17 02:01 sngeth

I'm seeing closed issues as well. This is the most recent one: https://github.com/golang/gddo/issues/233

That issue was closed on Sep 25, 2015 yet I received it in an email today.

email

nathany avatar Feb 01 '17 23:02 nathany

There may be something broken in our close issue task

schneems avatar Feb 05 '17 02:02 schneems

@schneems how often does the close task run?

Only thing I could see why @nathany would be receiving the issue was that the update_at returned 11/25/2016 despite being closed over a year ago

sngeth avatar Feb 28 '17 23:02 sngeth

There is apparently still an issue here. I just got an email from codetriage (my first in a LONG time) that suggested I look at #609, which was closed 18 days ago. (oddly enough due to a PR of mine that superseded it)

lostapathy avatar Nov 02 '17 16:11 lostapathy

Ugh, i'm guessing something is broken in one of the tasks :(

Have you gotten more that are closed since?

schneems avatar Nov 08 '17 21:11 schneems

I haven't noticed any, but I only really noticed the last one because I had worked it. I'll take a look at the rake tasks at some point and see if I can find anything, but I may need you to run something against production data to validate.

lostapathy avatar Nov 08 '17 22:11 lostapathy

I don't always receive emails and when I do they are already closed. I wonder if the volume of issues in https://github.com/godotengine/godot is giving some trouble to the system.

vnen avatar Jul 02 '18 01:07 vnen

We only update issues once every 24 hours, and then once again right before we send it out here https://github.com/codetriage/codetriage/blob/b92e347e0f4714b4646be930e341be5a44761b95/app/models/issue.rb#L8-L16.

Are they recently closed or closed a long time ago? Can you point me to a few of the issues that you've gotten?

schneems avatar Jul 02 '18 15:07 schneems

They were closed long ago. These are the two I got yesterday:

  • https://github.com/godotengine/godot/issues/9335
  • https://github.com/godotengine/godot/issues/9744

vnen avatar Jul 02 '18 16:07 vnen

Weird. I'm seeing that they shouldn't have been sent:

irb(main):013:0> user = User.where(github: "vnen").first
irb(main):014:0> Repo.where(full_name: "godotengine/godot").first.issues.where(number: "9335").first.valid_for_user?(user)
=> false

schneems avatar Jul 02 '18 16:07 schneems

I also received a notification for an issue that was closed 14 days ago. So another point against the 24 hours caching issue :/

image

klyonrad avatar Aug 17 '20 09:08 klyonrad