Giter VIP home page Giter VIP logo

Comments (4)

BatJan avatar BatJan commented on June 26, 2024

I experience that it's working kinda random...I see a mix of new and old threads in my list, which is quite confusing. Don't know if it may be a weird caching issue?

from ourumbraco.

greystate avatar greystate commented on June 26, 2024

Maybe it's just being ordered wrong?

I searched the source for "ACTIVITY IN THREADS YOU PARTICIPATED IN" and followed the rabbit to end up here:

var sql = new Sql().Select("TOP " + maxCount + " " +
@"forumTopics.*, u1.[text] as LastReplyAuthorName, u2.[text] as AuthorName,
forumComments.body as commentBody, forumComments.created as commentCreated, forumComments.haschildren,
forumComments.id as commentId, forumComments.isSpam as commentIsSpam, forumComments.memberId as commentMemberId, forumComments.parentCommentId,
forumComments.position, forumComments.score, forumComments.topicId")
.From("forumTopics")
.LeftOuterJoin("forumComments").On("forumTopics.id = forumComments.topicId")
.LeftOuterJoin("umbracoNode u1").On("(forumTopics.latestReplyAuthor = u1.id AND u1.nodeObjectType = '39EB0F98-B348-42A1-8662-E7EB18487560')")
.LeftOuterJoin("umbracoNode u2").On("(forumTopics.memberId = u2.id AND u2.nodeObjectType = '39EB0F98-B348-42A1-8662-E7EB18487560')")
.Where<Topic>(topic => topic.LatestReplyAuthor == memberId || topic.MemberId == memberId);

There's a couple of OrderByDescending() further down, but I don't know how it all works, so can't tell if there's caching involved or if the Topic.Updated could be in a wrong non-sortable format...

from ourumbraco.

villian avatar villian commented on June 26, 2024

There is a 5 minutes cache for this block. I think it's confusing because of caching. Ordering made here:

            sql
                .OrderByDescending<Topic>(x => x.Updated)
                .OrderByDescending<Comment>(comment => comment.Created);

from ourumbraco.

nul800sebastiaan avatar nul800sebastiaan commented on June 26, 2024

Yeah, as @villian says it's due to caching. If anyone wants to take a stab at fixing it that would be cool, it should be possible to temporarily add things to the cache while we wait for it to expire I think, not sure?

For now I'll close it as it does work "eventually", but feel free to open a PR for this. I've put the idea label on it so we can revisit it later when we have some more time to spare.

from ourumbraco.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.