AminoJS / Amino.JS

A powerful JavaScript library for interacting with the Amino API :star2:
MIT License
27 stars 5 forks source link

getComBlogFeed function bug #39

Closed fakenpc closed 6 years ago

fakenpc commented 6 years ago

Describe the bug When multiple call recentBlogs = await Amino.getComBlogFeed(community, 0, 1); in recentBlogs will be previuos results.

Fix screenshot_20180713_102220

felixfong227 commented 6 years ago

Hey @fakenpc thanks for the reporting in the issue, we are going to look into it, and BTW might I ask what do you mean by "Fix" and following by the image, does that mean you already have an solution or idea where we should put or hands into?

fakenpc commented 6 years ago

Yes, this is solution to this problem. This is a screenshot of the commit.

Code that reproduce error:

const env = require('./env');
const Amino = require('../index');
(async function () {
    const sid = await Amino.login(env.email, env.password);
    const yourCommunities = await Amino.getJoinedComs();
    let community = yourCommunities.coms[2].id; // there popular communty, where many post per minute
    let recentBlogs;

    recentBlogs = await Amino.getComBlogFeed(community, 0, 1);
    console.log(recentBlogs.blogs.length); // there 1 post
    //console.log(recentBlogs.blogs);

    console.log('Waiting new posts')
    await new Promise(resolve => setTimeout(resolve, 10000));

    recentBlogs = await Amino.getComBlogFeed(community, 0, 1);
    console.log(recentBlogs.blogs.length); // there are 2 posts: new and previous. But there should be 1 
    //console.log(recentBlogs.blogs);

})();
felixfong227 commented 6 years ago

Thank you for your reply @fakenpc 😀, you can always feel free to open a new pull request to resolve the issue, we will all be appreciated.

moelrobi commented 6 years ago

Hi!

First of all i apologize for not reply a lot of time. :-1:

Thank you for your Bugreport, i myself also notices these issues and they are getting fixed as soon as possible. I am currently working on an patch and hope you will continue using AminoJS.

moelrobi commented 6 years ago

This is also a Global Issue. See #34. Its a general Bug and will be patched in v.2.1 with Minor Readme Patches

moelrobi commented 6 years ago

Closes with #40.

Thanks for your Bugreport!