yogthos / memory-hole

Memory Hole is a support issue organizer application
MIT License
259 stars 25 forks source link

Wrong order of recently viewed issues #38

Closed jhamrsky closed 6 years ago

jhamrsky commented 6 years ago

Hello,

I think that recently viewed issues should be ordered by ASC instead of DESC - I would expect last viewed / created issue to be on top of the page, not on bottom. It was ok until f840fe07dcd82c090ee15599dd8df1b6b01ee703.

Furthermore, are we sure that last_viewed_date column name corresponds to its use? I can see this value to be updated when issue is created and updated, therefore it seems that:

yogthos commented 6 years ago

Good catch, I think the views metric is probably more useful than update metric. So, I'm thinking it would be better to keep the column, but update it when issue is selected as opposed to updated.

There is already an inc-issue-views! query for updating the view count that's called when the issue is loaded. It looks like it should be setting the last_viewed_date.

yogthos commented 6 years ago

I just pushed an update with the fix, let me know if it looks good. https://github.com/yogthos/memory-hole/commit/e2cf8fd469869437c0084d3934261f78a806e521