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

Use Feed Link as GUID when Feed omits Guid. #1785

Merged
merged 4 commits into from
May 24, 2022

Conversation

AccaliaDeElementia
Copy link
Contributor

@AccaliaDeElementia AccaliaDeElementia commented May 18, 2022

As noted in #1702 some feeds omit the GUID and while they are
valid RSS feeds they are not maximally compatible with all feed readers as the
guid element is a recommednation in RSS 2.0 to allow deduplication of feeds.

#1738 resolved the issue above by allowing all other feeds to
update correctly when a feed that omits the guid element is present.

This commit allows parsing of the guid omitting feed as well by assuming
that the item link of the feed is unique to the feed and using
it in place of the GUID when the feed omits the GUID.

This will allow NextCloud News to accept and behave like many other
popular feed aggregators when presented with such a feed.

As noted in nextcloud#1702 some feeds omit the GUID and are
therefore not a valid RSS feed.

nextcloud#1738 resolved the issue to allow valid feeds to
update correctly when an invalid feed is present.

This commit allows parsing of the invalid feed as well by assuming
that the item link of the feed is unique to the feed and using
it in place of the GUID when the feed omits the GUID.

This will allow NextCloud News to accept and behave like many other
popular feed aggregators when presented with such an invalid feed.

Signed-off-by: Accalia <Accalia@Elementia.me>
@codecov-commenter
Copy link

codecov-commenter commented May 18, 2022

Codecov Report

Merging #1785 (f4ed345) into master (fca05d5) will increase coverage by 0.03%.
The diff coverage is 100.00%.

@@             Coverage Diff              @@
##             master    #1785      +/-   ##
============================================
+ Coverage     91.62%   91.66%   +0.03%     
- Complexity      778      781       +3     
============================================
  Files            65       65              
  Lines          2724     2746      +22     
============================================
+ Hits           2496     2517      +21     
- Misses          228      229       +1     
Impacted Files Coverage Δ
lib/Db/Item.php 100.00% <100.00%> (ø)
lib/Fetcher/FeedFetcher.php 80.76% <100.00%> (+1.03%) ⬆️
lib/Command/ExploreGenerator.php 100.00% <0.00%> (ø)
lib/Explore/RecommendedSites.php 0.00% <0.00%> (ø)
lib/Controller/FeedController.php 100.00% <0.00%> (ø)
lib/Controller/PageController.php 100.00% <0.00%> (ø)
lib/Fetcher/Client/FeedIoClient.php 100.00% <0.00%> (ø)
lib/Controller/FeedApiController.php 100.00% <0.00%> (ø)
lib/Db/Feed.php 99.05% <0.00%> (+<0.01%) ⬆️
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6a8b904...f4ed345. Read the comment docs.

@Grotax Grotax requested a review from SMillerDev May 24, 2022 08:48
Signed-off-by: Accalia <Accalia@Elementia.me>
Signed-off-by: Accalia <Accalia@Elementia.me>
…for additional logging

Signed-off-by: Accalia <Accalia@Elementia.me>
@SMillerDev SMillerDev merged commit fdf037e into nextcloud:master May 24, 2022
Grotax added a commit that referenced this pull request May 29, 2022
Changed
- Add API v1.3 adding routes for starring/unstarring items by id and general fixes (#1727)
  https://nextcloud.github.io/news/api/api-v1-3/
- Improve styling of tables in articles (#1779)
- Allow fetching feeds that omit guid by using link as stand-in (#1785)

Fixed
- Fix updated api not returning any item after marking item as read (#1713)
- Fix deprecation warning for strip_tags() on a null value (#1766)
- Fix selected item being set incorrectly when using default ordering or newest first ordering (#1324)
- Fix doubling the height of the content area (#1796)

Signed-off-by: Benjamin Brahmer <info@b-brahmer.de>
@Grotax Grotax mentioned this pull request May 29, 2022
Grotax added a commit that referenced this pull request May 29, 2022
Changed
- Add API v1.3 adding routes for starring/unstarring items by id and general fixes (#1727)
  https://nextcloud.github.io/news/api/api-v1-3/
- Improve styling of tables in articles (#1779)
- Allow fetching feeds that omit guid by using link as stand-in (#1785)

Fixed
- Fix updated api not returning any item after marking item as read (#1713)
- Fix deprecation warning for strip_tags() on a null value (#1766)
- Fix selected item being set incorrectly when using default ordering or newest first ordering (#1324)
- Fix doubling the height of the content area (#1796)

Signed-off-by: Benjamin Brahmer <info@b-brahmer.de>
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

Successfully merging this pull request may close these issues.

4 participants