fix: Fetch reply contexts again (v2.10.2)
fetch_source returns (content, content_type, final_url) since v2.7.0, but fetch_reply_context unpacked two values, so every new reply/like/repost context was stored as an error. Parse with the final URL so relative links resolve. Adds a test that runs the real fetch path. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
f85be50072
commit
d73dd0a5b0
8 files changed
+103
-5
No files matched your search
@@ -470,5 +470,5 @@ def create_app(config=None):
|
||||
|
||||
# Package version (Semantic Versioning 2.0.0)
|
||||
# See docs/standards/versioning-strategy.md for details
|
||||
__version__ = "2.10.1"
|
||||
__version_info__ = (2, 10, 1)
|
||||
__version__ = "2.10.2"
|
||||
__version_info__ = (2, 10, 2)
|
||||
@@ -76,14 +76,16 @@ def fetch_reply_context(
|
||||
# Fetch and parse context
|
||||
try:
|
||||
# Fetch URL content
|
||||
content, content_type = fetch_source(reply_url, site_url)
|
||||
# fetch_source also returns the URL after redirects (v2.7.0); relative
|
||||
# links in the page resolve against it (v2.10.2)
|
||||
content, content_type, final_url = fetch_source(reply_url, site_url)
|
||||
|
||||
# Parse microformats (only for HTML)
|
||||
if 'html' not in content_type.lower():
|
||||
# Not HTML - store minimal context
|
||||
return _store_minimal_context(db_path, reply_url, "Not HTML content")
|
||||
|
||||
parsed_mf2 = mf2py.parse(doc=content, url=reply_url)
|
||||
parsed_mf2 = mf2py.parse(doc=content, url=final_url)
|
||||
|
||||
# Extract h-entry data
|
||||
entry_data = _extract_entry_data(parsed_mf2)
|
||||
|
||||
Reference in new issue
Block a user