CarsonHoffman / office-hours-queue

11 stars 7 forks source link

Cooldown doesn't seem to be working #39

Closed santiagomed closed 1 year ago

santiagomed commented 1 year ago

Right now cooldown for 485 is on for 600 seconds (10 min) yet students are still able to sign up immediately after being helped. Could I be missing something when it comes to setting up the cooldown?

image
CarsonHoffman commented 1 year ago

I can't find any such cases in the 485 queue. Could you provide the removed timestamps of two entries which you believe violate this? You can hover over the "XXX ago" item to see the exact time. (I can dig up more information based on those.)

santiagomed commented 1 year ago

I remember a specific case last Thursday afternoon. But I don't know if those timestamps are still saved. The stack doesn't let me see that far back. Is there another way I can look this up?

CarsonHoffman commented 1 year ago

You can hit the "Download" button on the stack to get everything. (Everything. 😛)

santiagomed commented 1 year ago

2023-01-26T13:37:17-05:00 and 2023-01-26T14:59:12-05:00

A friend just tested the cooldown and it did work. However, what I think might be happening is that the cooldown starts when they sign up, instead of when the are popped. The latter would be the desired behavior.

CarsonHoffman commented 1 year ago

I can't find either of the ones you listed. Could you provide their IDs (from the stack download)?

santiagomed commented 1 year ago

I just realized that there is no way to know when someone is finished being helped. The idea of the cooldown would be to prevent someone who was just helped from signing up again. However, if they are popped from the queue, and then helped for longer than 10 minutes, they would be able to join the queue immediately after an instructor is done helping them. The solution to this would be only pop them off the queue after they are helped, instead of right before an instructor starts helping them. And I don't think it would be a good idea to add this functionality to code since it would just add unnecessary complexity.

In conclusion the cooldown is working fine haha. Anyways, thanks for the help @CarsonHoffman

CarsonHoffman commented 1 year ago

Ah, I see. I would nudge against popping after helping a student because they get pop-ups/notifications that explicitly mention their help starting shortly, and it might be confusing to see that at the end. I suppose there's always the option of just baking it in and increasing the cooldown. 🤷‍♀️

santiagomed commented 1 year ago

Yeah I agree. Increasing the cooldown would be a better choice here

developStorm commented 1 year ago

With the change in #40, shall we consider to start the countdown when clicking "Done" instead of "Help"?

CarsonHoffman commented 1 year ago

That's already how it functions now. The cooldown is based on the pop time, which is what the Done button does; the new Help button invokes an entirely new property on which the cooldown isn't based.

developStorm commented 1 year ago

Yeah I just noticed this haha. It's actually great https://github.com/CarsonHoffman/office-hours-queue/blob/7fe48d280bb85f35fb097d0703f81aa19cfdbefd/server/db/queue.go#L304-L307

So looks like we can mark this issue as resolved now, as https://github.com/CarsonHoffman/office-hours-queue/issues/39#issuecomment-1411062772 is now implemented?

CarsonHoffman commented 1 year ago

Sounds good to me!