Problem

On "Your Posts" page (user/%/track and tracker/%) post are not being sorted correctly. Not all posts move up to the top when they are updated. It still reports when there are new comments, but it doesn't move those posts to the top of the list as it should.

Steps To Reproduce

Post a comment on an older issue, then go to user/%/track, or to tracker/%

Annotated Screenshot(s)

issue with new comment listed on page 5

Comments

giorgosk’s picture

Title: "Your Posts" block sorting doesn't update » "Your Posts" block + user/%/track not sorting correctly

also on the user/%/track you need to use the pager in order to find updated/new posts

dddave’s picture

drumm’s picture

Status: Closed (duplicate) » Active

Not actually a duplicate. And it is totally fixable by changing the orderBy() in drupalorg_block_view()'s case 'tracker_user':.

greggles’s picture

I'm not sure #3 takes into account the user/UID/track problem, does it?

jthorson’s picture

Status: Active » Needs review
StatusFileSize
new911 bytes

Changes sort order to node_comment_statistics.last_comment_timestamp DESC.

jthorson’s picture

Status: Needs review » Needs work

Previous patch sort of works, but during testing, appears to be prioritizing node body updates over comment updates.

jthorson’s picture

Status: Needs work » Needs review

Upon review ... I was looking at the wrong block. The 'Your Posts' block works great.

The 'Your Posts' page is not addressed by this patch.

alan d.’s picture

greggles marked this thread as the one to fix the user track sorts too, although this is really a different issue.

tvn’s picture

Project: [Archive] Drupal.org D7 upgrade QA » Drupal.org customizations
Version: » 7.x-3.x-dev
drumm’s picture

Title: "Your Posts" block + user/%/track not sorting correctly » user/%/track not sorting correctly
Status: Needs review » Active

Deployed the block change.

tvn’s picture

Issue tags: +Drupal.org 7.1
izmeez’s picture

The same problem occurs with /tracker/userID is that the same as this issue or should it be a separate issue?

johnpitcairn’s picture

I think /tracker/userid is likely the same issue.

giorgosk’s picture

Priority: Normal » Major

Its a major issue because we can't follow our posts progress anymore
People that have 500+ posts or issues that they follow its impractical to go through each page in the pager and check which posts have been updated ...

johnpitcairn’s picture

Issue summary: View changes
WorldFallz’s picture

FYI, since the dashboard block is now working correctly, in the meantime, you can edit the settings for that block and increase the # of posts to cover the amount of new posts you typically get.

Yeah it makes that page ugly and unbalanced, but at least you can function until the tracker itself has been fixed.

johnpitcairn’s picture

StatusFileSize
new140.93 KB
johnpitcairn’s picture

Issue summary: View changes
johnpitcairn’s picture

Issue summary: View changes

Updated summary to include page views, added a screenshot of updated issue shown on tracker page 5.

alan d.’s picture

dashboard block is now working correctly

It is only working correctly for issues, not for other tracked page types.
For example, this block also tracks non-issue pages and they don't get the comment "revision log" to correctly order.

#2133945: "Your posts" dashboard block sorts items on the last comment

alan d.’s picture

tvn’s picture

jthorson’s picture

Status: Active » Needs review
StatusFileSize
new12.75 KB
new1.93 KB

Attached patch contains a new feature, which overrides the default /tracker listings with a drupalorg_user_tracker view.

This fixes:
i) content is ordered by last comment time instead of last updated, resolving #2130537: user/%/track not sorting correctly and #2144333: Dashboard 'Your posts' sort order muddled.
ii) Pager length is limited, resolving #2130461: Tracker pager is inconsistent with every other pager in core.

However, as a trade-off:
i) The 'all recent content' and 'my recent content' tabs at the top of the /tracker page disappear.
ii) Book page edits no longer appear in the listing, as per #2133945: "Your posts" dashboard block sorts items on the last comment.

greggles’s picture

Did you benchmark the view? I believe the tracker page is highly optimized.

jthorson’s picture

Okay, this version fixes the book page edits as well, so the only regression left is the loss of the 'all recent content' and 'my recent content' tabs at the top of the /tracker page. Personally, I think I can live without them.

jthorson’s picture

Nope, haven't benchmarked anything. Modifying the tracker page queries may be another option, but I didn't dig into whether the optimized tracker exposes any hooks.

#2046683: Change /tracker page title to 'Recent content' should be considered if we roll this out as a feature, and #2130461: Tracker pager is inconsistent with every other pager in core closed.

jthorson’s picture

Okay ... my bad. I was comparing to the disabled 'tracker' view in my dev site, not the actual tracker which was visible.

So the actual /tracker page works well enough as is ... and my new comments do float to the top in the /tracker/%uid and user/%/track pages, but not comments by others.

In D6, comments by others also floated to the top.

Is this a change of functionality in the tracker module, perhaps?

greggles’s picture

No, this seems to be unique to d.o.

dww’s picture

Status: Needs review » Needs work

A) Yes, the user/%/track page is highly optimized.
-- On D6 d.o we used tracker2
-- In theory, D7's core tracker benefits from the results of tracker2

B) The issue follow flag stuff talks to the core tracker tables. This new view doesn't, so we'd have a major regression in functionality.

C) The tracker tables are exposed to views, so it should be possible to click a view together that's actually using the tracker tables instead of the raw node/comment tables.

D) Seems like if the core tracker isn't getting this right, it's a core bug, not something we should be working around in drupalorg. But, I know that's just my idealistic view of the world, and in reality, we'll probably have to do something here.

Anyway, I'd like to first understand what's actually going wrong with the core tracker before we resort to trying to re-implement this via a view. If we end up doing it via a view, it needs to use the tracker tables. And then, we'd need to see EXPLAIN results on the query from core vs the query from the view before we could deploy it.

Thanks/sorry,
-Derek

joachim’s picture

I wish I knew what was wrong with the core tracker. I can't say I've spotted any kind of pattern to the issues that show up there and those that don't.

At one point I thought it might be to with nodes that get a summary change vs a new comment, but I don't think that's it.

Right now, https://drupal.org/project/issues/user/107701 shows 2 nodes at the top which both say they have 15 new comments. The top one is one I've commented on in the past, so it's not a flag problem. Its most recent comment is now 13 minutes old, so that suggests it's probably not a cron problem.

Should we create a sandbox project just so we can create lots of dummy issues and see where they show up?

dww’s picture

No, I suspect we can re-create and debug this on a d.o dev site. Let's not pollute the real d.o with trying to debug this.

Thanks,
-Derek

tvn’s picture

Issue summary: View changes

Updated issue summary to clarify that dashboard block isn't affected anymore. If anyone wants a development site to try to figure out what's going on, let me know.

jonathan1055’s picture

I have tried to observe what is happening in my /user/%/track page (not block) and here are some things. If anyone knows them to be true, (or false) please feedback, then we might at least get a handle on what the page is doing.

  1. The page contains issues you have contributed to, and also issues you have not contributed to but have clicked the 'follow' button
  2. For issues you have contributed to, the 'last updated' time appears to be the time that you wrote your last comment, not the last overall comment
  3. For issues you have not contributed to, but are just 'following', the time appears to be the time you clicked 'follow' or maybe the most recent comment time at that point
  4. For automated 'fixed->closed' updates, we do get the 'updated' marker but the last updated date is not changed
  5. The behaviour in point 4 might be different if you are the original author of the issue. I have seen one auto closed issue move to the top of the page, and that was one I started (sample size of one so not conclusive)

OK, that is what I have observed. This is a starting point from which the theories can be tested and confirmed or adjusted. When we know consistently what the behavior is we can then work to fix it.

Jonathan

izmeez’s picture

@jonaathan1055 I think the first three are also true of tracker/uid and the last two might also be I just cannot confirm those.

joachim’s picture

> For issues you have contributed to, the 'last updated' time appears to be the time that you wrote your last comment, not the last overall comment

I can confirm that.

https://drupal.org/node/1971198 is showing for me on my tracker as 14 hours old, which is roughly when I last commented on it. On https://drupal.org/project/issues/user/107701 it correctly says it's 4 hours old.

This would explain the phenomenon of some issues showing up on the tracker and some not: if you commented on it recently enough it'll show up.

mgifford’s picture

Is this still a problem? I wasn't able to reproduce it.

mikeytown2’s picture

It is still a problem for me.
https://drupal.org/project/issues/user?status=All
and
https://drupal.org/user/%/track

Should be really close in term of sort order and they are not.

izmeez’s picture

This is also still a problem for me.
I am wondering if it is because this lists a mixture of issues and forum posts.
Really not sure what the problem is but would be nice to be able to resume using this.
Thanks.

izmeez’s picture

Edit: just realized i'm actually referring to https://drupal.org/tracker/%

Maybe it is fixed??
I have just looked through pages of https://drupal.org/user/%/track
I only found a couple of new items from 2 months ago so maybe they were missed during the time this issue was live. Going further back there aren't any. I was going through and checking deeper until the last month or so.
I'll keep a closer eye on it.

anavarre’s picture

Well, I can also confirm that https://drupal.org/user/UID/track is still completely broken for me. I currently have 50 pages of issues I need to go through every. single. day. instead of having a proper "last updated" display like on the D6 site and only 2 or 3 issue pages to review. (granted it's easier to rant about the issue than fixing it! ;-) )

yesct’s picture

StatusFileSize
new462.95 KB
new468.88 KB

@anavarre I'm not sure I understand what you mean when you say completely broken.

This is what I see:

What do you see?
Please give a specific example of an issue or post that is appearing out of order for you on that url.
Give an example of what you expected to see.

@mikeytown2 I see:

yesct’s picture

StatusFileSize
new322.22 KB
new178.67 KB

sorry, I looked at the summary again, and then into this more... on pages in.

For
@mikeytown2
on page 5, I saw

Issue	Build menu_tree without loading so many objects new	johnv	49
10 new	1 month 2 weeks ago

And when I go to that issue
https://drupal.org/node/1978176#new

I see

#44
Posted by derMatze on March 18, 2014 at 3:04am new
Afte

Which is *not* 1 month 2 weeks ago.

anavarre’s picture

StatusFileSize
new208.01 KB

@YesCT - Sorry, I should probably have given more details. While "completely broken" is certainly an exaggeration, what I remember was working before on https://drupal.org/user/UID/track (D6) was:

  • Issues were ordered by "last updated" with the red string "updated" to show you what issues you had to review
  • On a normal day you had 1, 2 or 3 pages with those updated issues to go through in order to catch up with everything

Now, the "broken part" I'm talking about is that it's no longer ordered by "last updated" the way I expect it should be. Issues with the red string "updated" are still relevant, newly updated issues, BUT they are not ordered correctly. Hopefully the below screenshot is useful to get my point. Before I would never have had to paginate through 26 (or way more) pages to see updated issues.

It's as if you would have a news site for which you would have to drill down through the pagination until you make sure you see all updated articles. The expected behavior is that you have them all, immediately.

Happy to clarify anything else that's still unclear.

alan d.’s picture

Dashboard block works, although some issues with non-project pages. Just make sure that you visit enough not to loss post off the end of that list ;)

The Post page links to a random comment date, sometimes the latest, sometimes the last comment you posted, and then to a lesser extent another random comment. Comparing both the dashboard block / your posts page code should reveal issue here.

Generally a bit funky overall,

For #1525176: Using array_diff_assoc() for multilevel arrays in DrupalDefaultEntityController->cacheGet(), (last comment March 22, 2014 at 7:32am), which I have commented in but currently unsubscribed:
- This always shows on the Dashboard when updated. While "Unsubscribed" does not appear to work, at least the ordering does!
- It is completely missing from the my Your Issues queue. Unsubscribed appears to work here.
- Is on page 9 of the Your posts page, apparently last updated 4 months 3 weeks ago.

greggles’s picture

FWIW, I've started using https://drupal.org/project/issues/search?participant=greggles instead of the tracker urls. It seems to sort better except it doesn't include forum posts.

anavarre’s picture

@greggles Very good idea! And IMO not including forum posts is actually a big +1

m1r1k’s picture

Assigned: Unassigned » m1r1k
tvn’s picture

m1r1k’s picture

tvn’s picture

Status: Needs work » Postponed

Postponing on the core issue.

jstoller’s picture

StatusFileSize
new209.4 KB

I thought the "Your Posts" list on my dashboard was fixed, but apparently not.

johnpitcairn’s picture

I have the same problem. This appears to have become broken again a couple of days ago. Most annoying.

valthebald’s picture

Status: Postponed » Closed (duplicate)
greggles’s picture

Status: Closed (duplicate) » Postponed

Are you sure this is a duplicate?

This issue is about user/%/track which is a core callback.

That issue is about a custom block.

I see from comment #21 on that issue that you believe this is also fixed but in my experience just now looking at my tracker it does not appear to be fixed (a forum post with a comment 5 days ago shows as last updated "2 weeks 4 days ago") although it does seem to be in the right spot in the order of all issues.

I consider that last point (the "Last updated" column shows the wrong information) to be very minor compared to an incorrect sort order so if that's the only thing remaining I'd be OK making this a "normal" priority issue focused on that last piece.

valthebald’s picture

#54: agreed

alan d.’s picture

From #2133945-21: "Your posts" dashboard block sorts items on the last comment

All that said, we should review if adding a new comment updates user_tracker. I believe it should

This could be the root cause, so has anyone investigated this?

1) From adding a comment from the embedded views page.
2) From editing the node
3) Automated git messages
4) Automated status change messages

And maybe

5) Errors in the logs in any area related to comments on d.o.
6) Master / Slave issue?

[edit]
Some tests:
1) Adding the comment on the view page pushed this to the top of all 3 queues (dashboard block, track and your issues page)
2) Adding a comment from the edit page also pushed this to the top of all 3 queues
3) Editing an existing issue summary, pushed this up in both dashboard and tracker, but not the your issues, but maybe a caching issue. I'll have to get back in an hour or so to check that.

[edit2]
Editing a comment:
Showed at the top in both the dashboard and tracker pages, so strange :/
Did not appear on my "your issues", which is now a couple issues behind now; maybe caching?

[edit3]
Not related this this issue, but when I updated an issue that I wrote and was following (via view and edit page), this did not show in the Your issues page. I repeated with another issue that I authored, but had unsubscribed, and that issue showed on the Your issues page :P

drumm’s picture

Status: Postponed » Fixed

#2224917: Tracker page doesn't order results properly is now deployed on Drupal.org, so I believe this should be fixed. Posts with revisions and comments after now should be sorted correctly.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.