From 9e6a528e5735d24dd07d1cb9b027bb7faf5a109c Mon Sep 17 00:00:00 2001 From: Estrella Pan Date: Sun, 25 Jan 2026 17:33:46 +0100 Subject: [PATCH] fix(search): resolve multiple issues in search and subscription flow - Fix axios interceptor error when response.data is undefined by adding optional chaining (?.msg_en, ?.msg_zh) - Fix XML parsing crash in backend by catching ParseError exceptions - Remove brotli (br) from Accept-Encoding header to fix mikan RSS fetch issues (httpx doesn't auto-decompress brotli) - Fix search card click event not triggering confirmation modal by changing from native 'click' to custom 'select' event with typed payload - Add NMessageProvider to App.vue to fix useMessage() outside setup error - Replace structuredClone with JSON.parse/stringify in confirm modal to handle Vue reactive Proxy objects Co-Authored-By: Claude Opus 4.5 --- .../src/module/network/request_contents.py | 6 +- backend/src/module/network/request_url.py | 2 +- webui/src/App.vue | 6 +- .../src/components/search/ab-search-card.vue | 8 +- .../components/search/ab-search-confirm.vue | 281 ++++++++++++++---- .../src/components/search/ab-search-modal.vue | 38 ++- webui/src/utils/axios.ts | 4 +- 7 files changed, 266 insertions(+), 79 deletions(-) diff --git a/backend/src/module/network/request_contents.py b/backend/src/module/network/request_contents.py index a2c7ebff..0ea39d4a 100644 --- a/backend/src/module/network/request_contents.py +++ b/backend/src/module/network/request_contents.py @@ -41,7 +41,11 @@ class RequestContent(RequestURL): async def get_xml(self, _url, retry: int = 3) -> xml.etree.ElementTree.Element: req = await self.get_url(_url, retry) if req: - return xml.etree.ElementTree.fromstring(req.text) + try: + return xml.etree.ElementTree.fromstring(req.text) + except xml.etree.ElementTree.ParseError as e: + logger.warning(f"[Network] Failed to parse XML from {_url}: {e}") + return None # API JSON async def get_json(self, _url) -> dict: diff --git a/backend/src/module/network/request_url.py b/backend/src/module/network/request_url.py index 6285c34a..2c72ffd5 100644 --- a/backend/src/module/network/request_url.py +++ b/backend/src/module/network/request_url.py @@ -62,7 +62,7 @@ class RequestURL: base_headers = { "User-Agent": self.DEFAULT_UA, "Accept-Language": "en-US,en;q=0.9", - "Accept-Encoding": "gzip, deflate, br", + "Accept-Encoding": "gzip, deflate", "Connection": "keep-alive", } # For torrent files, use different Accept header diff --git a/webui/src/App.vue b/webui/src/App.vue index 21e28b3a..91dd422e 100644 --- a/webui/src/App.vue +++ b/webui/src/App.vue @@ -1,6 +1,6 @@ @@ -56,8 +100,8 @@ function handleConfirm() {
-