Giter Site home page Giter Site logo

Comments (13)

tterb avatar tterb commented on June 13, 2024 1

@watawep23 It appears that the following function in the CommentCount component might not be keeping the count updated like it's supposed to.

const queueResetCount = debounce(() => {
    if (window.DISQUSWIDGETS)
        window.DISQUSWIDGETS.getCount({ reset: true });
}, 300, false); // eslint-disable-line no-magic-numbers

I've labelled this as a bug and will work on finding a solution.

from disqus-react.

tterb avatar tterb commented on June 13, 2024 1

I looked deeper into this issue and it appears that the issue is that the count.js script that the CommentCount component relies on is not intended to update in realtime and can have a delay of up to 10 minutes.

Nonetheless, I'm going to investigate potential options for providing more responsive comment count data, so I'm going to label this as an enhancement rather than a bug for now.

from disqus-react.

watawep23 avatar watawep23 commented on June 13, 2024

It seems like there's a delay on updating the current comment count. Do you know how to fix that?

from disqus-react.

tterb avatar tterb commented on June 13, 2024

@watawep23 Could you provide the steps to reproduce this issue?

from disqus-react.

watawep23 avatar watawep23 commented on June 13, 2024

Hello, actually there are no steps to reproduce this issue, as soon as i load my post it shows no comment count for about 20 minutes or less.

My code looks like this:

const Post = (props) => {
    const {title, content, createdAt, imageUrl, userId: {name}, _id} = props.details;
    const newImgUrl = imageUrl.replace('\\', '/'); // replacing the \ in imageUrl to prevent questionmark in backgroundimage url
    const imgSrc = `${baseUrl()}/${newImgUrl}`;
    let preview = stripHTML(content).substr(0, DEFAULT_STR_LENGTH);

    if (stripHTML(content).length > DEFAULT_STR_LENGTH) {
        preview += '...';
    }

    const disqusShortname = '*****';
    const disqusConfig = {
        url: window.location.href,
        identifier: _id,
        title: title,
    };

    return (
        <article className={classes.Post}>
            <div className={classes.Post__date}>
                <p className={classes.Post__date_m}>{moment(createdAt).format('MMMM')}</p>
                <p className={classes.Post__date_y}>{moment(createdAt).format('YYYY')}</p>
                <p className={classes.Post__date_d}>{moment(createdAt).format('D')}</p>
            </div>
            <Link to={`/post/${slugify(title, {lower: true})}`} className={classes.Post__banner_link}>
                <div className={classes.Post__banner} style={{backgroundImage: `url(${imgSrc})`}}></div>
            </Link>
            <div className={classes.Post__content}>
                <h1 className={classes.Post__title}>
                    <Link to={`/post/${slugify(title, {lower: true})}`}>{title}</Link>
                </h1>
                <ul className={classes.Post__meta}>
                    <li>By: <strong>{name}</strong></li>
                    <li>
                        <Disqus.CommentCount shortname={disqusShortname} config={disqusConfig}>
                            Comments
                        </Disqus.CommentCount>
                    </li>
                </ul>
                <p className={classes.Post__preview}>{preview}</p>
            </div>
        </article>
    ); 
}

I'm using Create React App.

from disqus-react.

tterb avatar tterb commented on June 13, 2024

@watawep23 Thanks for info. I'll look into this tomorrow and see if I'm able to reproduce the issue and find a potential solution.

from disqus-react.

watawep23 avatar watawep23 commented on June 13, 2024

@tterb Noted. Thank you for your help.

from disqus-react.

 avatar commented on June 13, 2024

Hi! The comment count still seems inaccurate, is there any updates on this? Should this issue still be open if it's not fixed?

from disqus-react.

tterb avatar tterb commented on June 13, 2024

@positimo As I mentioned above, the count.js script that the CommentCount component relies on is heavily cached within the Disqus service.
At this time there isn't an alternative way of retrieving a real-time comment count, but I have shared this concern with the team internally.

from disqus-react.

 avatar commented on June 13, 2024

Right, OK, I was just surprised to not find this issue immediately although it's still pending..

from disqus-react.

marcossilvabr avatar marcossilvabr commented on June 13, 2024

Hi :)
Just wanted to know if we have any news on this or if is still an issue. On my side, it is not working properly and I don't know if this is still a bug or if I'm doing something wrong. Thanks

from disqus-react.

Stumblor avatar Stumblor commented on June 13, 2024

Yep, also an issue here. Comment counters not updating, calling

DISQUSWIDGETS.getCount({ reset: true })

has no effect.

from disqus-react.

Ekbal41 avatar Ekbal41 commented on June 13, 2024

same issue 😔

from disqus-react.

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.