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

WikiPage constructor hangs #94

Open
rwv37 opened this issue Feb 8, 2022 · 2 comments
Open

WikiPage constructor hangs #94

rwv37 opened this issue Feb 8, 2022 · 2 comments

Comments

@rwv37
Copy link

rwv37 commented Feb 8, 2022

I have the following class:

internal class WantedPage : WikiPage
{
    internal WantedPage(WikiPage wikiPage) : base(wikiPage.Site, wikiPage.Title)
    {
    }
}

It (and other classes like it) have been working fine for me for a while now, but I just found a problem where my program hangs, apparently during the call to the base constructor.

Specifically, I received (from the QueryPageGenerator for Wantedpages) a WikiPage object with the title WP:Namespace. One thing that I think might be important to note at this point: I previously added an interwiki to my site to direct "WP:xxxx" to (wikipedia)/WP:xxxx".

Anyway, I fed that WikiPage to my WantedPage classes constructor, and it seems to hang there indefinitely: If I stick this...

Log.Error($"Made wanted page {this.Title} from wiki page {wikiPage.Title}!");

... inside of the body of the constructor, the log message never happens (for WP:Namespace; it does happen for all titles I've encountered).

Now that I've figured out that this is apparently where my program is hanging, I'll be able to work around it without much trouble, but I wanted to report the bug anyway.

@CXuesong
Copy link
Owner

Please do not inherit from WikiPage class. This class is not intended to be derived unless you know what you are doing.

Also, this class does not take care of Special pages. Please use QueryPageGenerator.EnumItemsAsync if you want to query for WantedPages.

@rwv37
Copy link
Author

rwv37 commented Feb 12, 2022

I'm not sure that I understand your comment about special pages. Like I said: "I received (from the QueryPageGenerator for Wantedpages) a WikiPage object with the title WP:Namespace".

The problem occurred when I then passed that WikiPage object (call it "wp" for the sake of example) to (essentially) new WikiPage(wp.site, wp.title).

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

No branches or pull requests

2 participants