Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugs with comment api. #214

Open
SupremeDeity opened this issue Sep 1, 2021 · 1 comment
Open

Bugs with comment api. #214

SupremeDeity opened this issue Sep 1, 2021 · 1 comment

Comments

@SupremeDeity
Copy link
Contributor

SupremeDeity commented Sep 1, 2021

The Comment api is currently almost unusable. I thought it was a error on my side but both the toList() function and replaceMore() function aren't working as intended. The replaceMore() function is not expanding the comments correctly since using this snippet should have expanded every single MoreComment:

Submission submission = await reddit.submission(id: 'pfkjio').populate();
  if (submission.comments != null) {
    await submission.comments!.replaceMore(limit: 100000000);
    for (var comment in submission.comments!.comments) {
      print(comment.body);
    }
  }

However i still get a error relating to MoreComments. Moreover this if check is being ignored or something because toList() is also returning me MoreComment instances (comment_forest.dart:85):

 if ((comment is! MoreComments) && (comment.replies != null)) {
        queue.addAll(comment.replies._comments);
  }

Also when printing out the runtimeType with the first snippet the results are similar to this:

Comment
Comment
Comment
Comment
MoreComments
Comment
Comment
MoreComments
Comment

Which means child MoreComments aren't being expanded.

From my testing it also seems that DRAW shows and expands way less MoreComments than praw does.

@SupremeDeity
Copy link
Contributor Author

With a bit more investigation, even though the code in Comment_Forest is a almost exact copy of praw, i dont think the code in praw or in draw actually makes it so that setting limit to 0 expands all the MoreComments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant