From f08d28d70bd5c275f99b848ba0da15d94ea72f3d Mon Sep 17 00:00:00 2001 From: CyberMind-FR Date: Wed, 31 Dec 2025 11:51:13 +0100 Subject: [PATCH] fix(secubox): correct RPC expect parameter for getAppstoreApps MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixed appstore showing "No applications match the selected filter" by correcting the RPC declaration expect parameter. Issue: The RPC declaration had: expect: { apps: [], categories: {} } This caused the RPC framework to return only the apps array instead of the full response object, resulting in: - data = Array(5) instead of { apps: [...], categories: {...} } - data.apps = undefined - data.categories = undefined Fix: Changed to: expect: { } This returns the full response object as-is from the backend, allowing proper access to both data.apps and data.categories properties. Also added extensive debug logging to troubleshoot the data flow. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 --- .../htdocs/luci-static/resources/secubox/api.js | 2 +- .../htdocs/luci-static/resources/view/secubox/apps.js | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/luci-app-secubox/htdocs/luci-static/resources/secubox/api.js b/luci-app-secubox/htdocs/luci-static/resources/secubox/api.js index 07b126a9..55caae12 100644 --- a/luci-app-secubox/htdocs/luci-static/resources/secubox/api.js +++ b/luci-app-secubox/htdocs/luci-static/resources/secubox/api.js @@ -195,7 +195,7 @@ var callRollbackProfile = rpc.declare({ var callGetAppstoreApps = rpc.declare({ object: 'luci.secubox', method: 'get_appstore_apps', - expect: { apps: [], categories: {} } + expect: { } }); var callGetAppstoreApp = rpc.declare({ diff --git a/luci-app-secubox/htdocs/luci-static/resources/view/secubox/apps.js b/luci-app-secubox/htdocs/luci-static/resources/view/secubox/apps.js index 797734ab..63a8e3d0 100644 --- a/luci-app-secubox/htdocs/luci-static/resources/view/secubox/apps.js +++ b/luci-app-secubox/htdocs/luci-static/resources/view/secubox/apps.js @@ -44,12 +44,17 @@ return view.extend({ refreshData: function() { var self = this; return API.getAppstoreApps().then(function(data) { + console.log('getAppstoreApps raw response:', data); if (!data) { console.warn('getAppstoreApps returned empty data'); return { apps: [], categories: {} }; } + console.log('Apps from API:', data.apps); + console.log('Categories from API:', data.categories); self.appsData = data.apps || []; self.categoriesData = data.categories || {}; + console.log('Stored appsData:', self.appsData); + console.log('Stored categoriesData:', self.categoriesData); return data; }).catch(function(err) { console.error('Error loading appstore apps:', err); @@ -63,6 +68,12 @@ return view.extend({ var apps = (data && data.apps) || this.appsData || []; var categories = (data && data.categories) || this.categoriesData || {}; + // Debug logging + console.log('Apps render - data:', data); + console.log('Apps render - apps array:', apps); + console.log('Apps render - apps.length:', apps.length); + console.log('Apps render - categories:', categories); + var defaultFilter = this.currentFilter || 'all'; var container = E('div', { 'class': 'secubox-apps-page',