From d36738d7ef5be65b4caa949309db8a0779a9060d Mon Sep 17 00:00:00 2001 From: dgtlmoon Date: Tue, 13 Jan 2026 16:31:58 +0100 Subject: [PATCH] RSS - Bugfix - possible edge case of wrong feed info could be rendered (#3733) --- changedetectionio/blueprint/rss/single_watch.py | 5 +---- changedetectionio/blueprint/rss/tag.py | 7 ++----- changedetectionio/tests/test_live_preview.py | 13 +++++++------ 3 files changed, 10 insertions(+), 15 deletions(-) diff --git a/changedetectionio/blueprint/rss/single_watch.py b/changedetectionio/blueprint/rss/single_watch.py index 3cfdb1900..1d011902d 100644 --- a/changedetectionio/blueprint/rss/single_watch.py +++ b/changedetectionio/blueprint/rss/single_watch.py @@ -47,9 +47,6 @@ def construct_single_watch_routes(rss_blueprint, datastore): if len(dates) < 2: return f"Watch {uuid} does not have enough history snapshots to show changes (need at least 2)", 400 - # Add uuid to watch for proper functioning - watch['uuid'] = uuid - # Get the number of diffs to include (default: 5) rss_diff_length = datastore.data['settings']['application'].get('rss_diff_length', 5) @@ -101,7 +98,7 @@ def construct_single_watch_routes(rss_blueprint, datastore): date_index_from, date_index_to) # Create and populate feed entry - guid = f"{watch['uuid']}/{timestamp_to}" + guid = f"{uuid}/{timestamp_to}" fe = fg.add_entry() title_suffix = f"Change @ {res['original_context']['change_datetime']}" populate_feed_entry(fe, watch, res.get('body', ''), guid, timestamp_to, diff --git a/changedetectionio/blueprint/rss/tag.py b/changedetectionio/blueprint/rss/tag.py index 7e22af71d..8459234ba 100644 --- a/changedetectionio/blueprint/rss/tag.py +++ b/changedetectionio/blueprint/rss/tag.py @@ -63,11 +63,8 @@ def construct_tag_routes(rss_blueprint, datastore): # Only include unviewed watches if not watch.viewed: - # Add uuid to watch for proper functioning - watch['uuid'] = uuid - - # Include a link to the diff page - diff_link = {'href': url_for('ui.ui_diff.diff_history_page', uuid=watch['uuid'], _external=True)} + # Include a link to the diff page (use uuid from loop, don't modify watch dict) + diff_link = {'href': url_for('ui.ui_diff.diff_history_page', uuid=uuid, _external=True)} # Get watch label watch_label = get_watch_label(datastore, watch) diff --git a/changedetectionio/tests/test_live_preview.py b/changedetectionio/tests/test_live_preview.py index 8c8f874b2..b9c26be3b 100644 --- a/changedetectionio/tests/test_live_preview.py +++ b/changedetectionio/tests/test_live_preview.py @@ -25,12 +25,13 @@ def test_content_filter_live_preview(client, live_server, measure_memory_usage, test_url = url_for('test_endpoint', _external=True) - res = client.post( - url_for("ui.ui_views.form_quick_watch_add"), - data={"url": test_url, "tags": ''}, - follow_redirects=True - ) - uuid = next(iter(live_server.app.config['DATASTORE'].data['watching'])) + + uuid = client.application.config.get('DATASTORE').add_watch(url=test_url) + res = client.get(url_for("ui.form_watch_checknow"), follow_redirects=True) + assert b'Queued 1 watch for rechecking.' in res.data + + wait_for_all_checks(client) + res = client.post( url_for("ui.ui_edit.edit_page", uuid=uuid), data={