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

Cannot resubscribe to recently-deleted feed #1412

Closed
3 tasks done
uPvtkBlpiucvDUf opened this issue Jun 17, 2021 · 15 comments
Closed
3 tasks done

Cannot resubscribe to recently-deleted feed #1412

uPvtkBlpiucvDUf opened this issue Jun 17, 2021 · 15 comments

Comments

@uPvtkBlpiucvDUf
Copy link

IMPORTANT

Read and tick the following checkbox after you have created the issue or place an x inside the brackets ;)

  • I have read the CONTRIBUTING.md and followed the provided tips
  • I accept that the issue will be closed without comment if I do not check here
  • I accept that the issue will be closed without comment if I do not fill out all items in the issue template.

Explain the Problem

What problem did you encounter?

If I delete a feed and immediately (or shortly) after that try to resubscribe to the same feed, the feed is not added. No useful error message ist shown, but if I check the browser console network tab, I see a response

{"message":"Feed with this URL exists"}

I had a look at the oc_news_feeds table and indeed an entry with the URL I deleted and tried to resubscribe still exists, but with non-zero deleted_at. I guess this means that this entry is marked as deleted but the actual deletion will happen only when the cron job runs the next time? To check this, I ran

occ news:updater:before-update

and after that I could successfully resubscribe to the just-deleted feed.

I guess this problem would have solved itself if I had just waited a while for the cron job to run. Still, it would probably be better to just immediately purge a feed with non-zero deleted_at when someone tries to subscribe to it again.

Steps to Reproduce

  1. Delete a feed
  2. Immediately resubscribe to the same feed
  3. Doesn't work (error in browser's Network tab)
  4. Run occ news:updater:before-update
  5. Now subscribing works

System Information

  • News app version: 15.4.5
  • Nextcloud version: 21.0.1
  • Cron type: system cron
  • PHP version: 7.4
  • Database and version: mysql 8
  • Browser and version: firefox 89
  • OS and version: Gentoo Linux
Contents of Browser Error Console Read http://ggnome.com/wiki/Using_The_Browser_Error_Console if you are unsure what to put here
POSThttps://XXX/apps/news/feeds
[HTTP/2 409 Conflict 97ms]

TypeError: can't convert undefined to object
    publishAll Publisher.js:34
    createFeed NavigationController.js:216
    Angular 13
    jQuery 9
    Angular 24
    jQuery 12
    Webpack 6
 Possibly unhandled rejection: {}
@SMillerDev
Copy link
Contributor

This is actually a feature that allows some clients to undo deletion.

@stale
Copy link

stale bot commented Jul 21, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the stale label Jul 21, 2021
@ccscoggins
Copy link

This is actually a feature that allows some clients to undo deletion.

Alright so... how do we fix it? In the standard, fresh-install web client, there's no obvious way to resubscribe to a recently deleted feed, so making the 'add feed' option specifically not work in this scenario makes no real sense in my opinion as an end-user. Deleted feeds are also inaccessible through occ, so even if I could re-add them that way, I can't find them in order to re-add them.

Why are duplicate feeds even designed to not work in the first place?

@stale stale bot removed the stale label Sep 4, 2021
@SMillerDev
Copy link
Contributor

In the standard, fresh-install web client, there's no obvious way to resubscribe to a recently deleted feed

That sounds like a web bug because there used to be one for years.

Why are duplicate feeds even designed to not work in the first place?

Because it makes sense to identify feeds by their URL and you can't have duplicate identifier information, otherwise it's not identifying anymore.

@zhurin
Copy link

zhurin commented Sep 4, 2021

I installed News 16.0.1 and ran into this bug, too. There's no list of deleted subscriptions to restore from and when trying to resubscribe, even after more than the 5-minute cron interval, results in an error that the URL exists.

If the URL exists, but is marked deleted, then re-adding the subscription can just restore the existing subscription entry.

@Grotax
Copy link
Member

Grotax commented Sep 5, 2021

Hi, yea the front-end is not maintained, nobody so far was interested and skilled enough to fix it. And since it's already so old lots of the libraries it uses are not supported anymore.

So I'm starting to consider removing the front-end entirely, as it has to completely break at some point.

In the meantime for me, reloading the page has always helped, seems like the entry gets stuck in the menu.

@andydld
Copy link

andydld commented Oct 25, 2021

Hello,

maybe the same here.
One of the newsfeeds stopped working, so i deleted this one two days ago.
After trying to resubscribe, i've got the same message ("Feed with this URL exists").
I checked the DB, but there's no entry under "oc_news_feeds" with the feed-url.
"occ news:updater:before-update" doesn't help.
Reboot of the machine (NextCloudPi) or changing the browser (Firefox, Brave) doesn't help, too.

Here are the feed-urls:

https://www.mailstore.com/de/feed/?utm_source=blog-feed&utm_medium=rss&utm_campaign=blog-rss-de
https://www.mailstore.com/de/feed/

@Grotax
Copy link
Member

Grotax commented Oct 25, 2021

Hey I think there are two possible causes for this.

Either you actually still have this feed in your dB and the backend finds it can complains.

Or you don't have that feed anymore but it is still stuck in your webclient session.

Usually when you delete a feed, it still stays in the list with a small arrow symbol next to it.

The issue I often had in testing that also after some waiting I couldn't add the feed again, refreshing the page in the browser helped in that case.

But at the top in the original issue you also said that you didn't see the error, news has a spot at the top in the UI to display errors in a red box.

So I don't know maybe the web-ui is falling apart for you now. Code to old and suspicious, so that your browsers filter some stuff out.

Some more general architectural thoughts:

Maybe also the "newly" introduced update method interferes with the deleting process. As we switched from running with every Cron to a timed job, for which you can configure the the settings in the admin page.
I'm not sure but this might delay the deletion of the feed a lot because it's actually only triggered after X time after the last execution has passed.
And when people mess with the updater or Nextcloud has a hickup the job is not triggered by Nextcloud for ~24h for some reason.

Having a restore function is I guess more user-friendly but I don't think most clients implemented it with the current API.

@andydld
Copy link

andydld commented Oct 26, 2021

Hi Grotax,

thanks for your reply. Maybe i found the reason for "my problem". After some more tests with adding and deleting other feeds, which works like expected, i found out only the MailStore-Feed doesnt work. This feed doesnt work with other feedreader, too, so i came to the conclusion that there must be something wrong with this one.

I looked at the feed-xml with an browser and wondering why it starts like this:

/<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"

The "/" at the beginning is wrong (so far as i know).
I checked other feeds and they all doenst have this kind of beginning.

After my today tests i found entries likes this within the "nextcloud.log":

... "app":"news","method":"POST","url":"/index.php/apps/news/feeds","message":"https://www.mailstore.com/de/feed/ read error : this document is not a XML stream","...

I have no idea why i missed this yesterday, there are no entries like this in the past.

Well, i contacted the feed-creator and discribed the problem.

@andydld
Copy link

andydld commented Oct 27, 2021

The creator fixed the newsfeed, so my problem is solved.

@phedlund
Copy link
Contributor

I actually find this "feature" to be a problem when developing a client. Being able to quickly delete and re-add feeds would greatly help when debugging a client.

@Grotax
Copy link
Member

Grotax commented Nov 15, 2021

Yea I'm also not a big fan of it, at least not in the current form.
I guess the easiest solution would be if you add a feed that is currently maked as deleted to simply remove the mark and make it available again.
And trigger an immediate update for the feed, as that is maybe what the user wanted to achieve.

Not sure how easy that is to implement, news is older than Nextcloud itself so yea..

@litLizard69
Copy link

I have the same problem. It's so annoying I hope it gets fixed soon.

Yours sincerely

@stale
Copy link

stale bot commented Jan 8, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the stale label Jan 8, 2022
@stale stale bot closed this as completed Apr 16, 2022
@BtbN
Copy link

BtbN commented Jul 10, 2022

Still having this exact issue today.

@nextcloud nextcloud locked and limited conversation to collaborators Jul 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

9 participants