getmango / Mango

Mango is a self-hosted manga server and web reader
https://getmango.app
MIT License
1.69k stars 118 forks source link

[Bug Report] Subscription Manager always shows "No subscriptions found." even with subscriptions added #329

Open melyux opened 1 year ago

melyux commented 1 year ago

Describe the bug The Subscription Manager always shows "No subscriptions found." despite subscriptions existing and working.

To Reproduce Steps to reproduce the behavior:

  1. Go to Download > Plugins, create a subscription, confirm that the subscriptions.json file exists under the plugin.
  2. Optionally, wait until a new chapter comes out and see that it downloads automatically.
  3. Go to Download > Subscription Manager.
  4. See "No subscriptions found.": image

Expected behavior I assume there's normally a table to view and edit existing subscriptions.

Environment (please complete the following information):

Docker (if you are running Mango in a Docker container)

Additional context Add any other context about the problem here. Add screenshots if applicable. (See screenshot above)

I can see that the call to <base>/api/admin/plugin/subscriptions?plugin=<plugin> is returning the correct data. I see <p x-show="subscriptions.length === 0" class="uk-text-meta">No subscriptions found.</p> has the subscriptions.length === 0 condition on it (not familiar with the framework here), but I can see from a call to the API myself that subscriptions does not have a zero length.

hkalexling commented 1 year ago

That's very strange. Did you see any error messages (from either the web UI or browser console) when loading the page? Normally the response from the API is passed immediately to the subscriptions array (JS code here)

melyux commented 1 year ago

That's very strange. Did you see any error messages (from either the web UI or browser console) when loading the page? Normally the response from the API is passed immediately to the subscriptions array (JS code here)

No web UI nor console errors. That's why I'm not sure how to debug any further. I only have one plug-in, I'll try adding another one and see if it kickstarts the load upon switching to another plugin. And check the web server error logs, if I can find some. Maybe the internal API request to grab subscriptions per plugin is failing.

hkalexling commented 1 year ago

I only have one plug-in, I'll try adding another one and see if it kickstarts the load upon switching to another plugin.

Ahh yes that's the issue. I just noticed a bug in the JS code. The subscriptions won't be loaded when you have only one plugin installed. Will fix this in the next update. Thanks for reporting!