{"record":{"id":"b6691e665d175516","repo":"RocketChat/Rocket.Chat","slug":"no-results-found","errorCode":null,"errorMessage":"No_results_found","messagePattern":"No_results_found","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"info","filePath":"apps/meteor/client/views/marketplace/AppDetailsPage/tabs/AppReleases/AppReleases.tsx","lineNumber":22,"sourceCode":"import { useQuery } from '@tanstack/react-query';\nimport { useTranslation } from 'react-i18next';\n\nimport AppReleasesItem from './AppReleasesItem';\nimport AccordionLoading from '../../../components/AccordionLoading';\n\nexport type AppReleasesProps = { id: App['id'] };\n\nconst AppReleases = ({ id }: AppReleasesProps) => {\n\tconst getVersions = useEndpoint('GET', '/apps/:id/versions', { id });\n\tconst { t } = useTranslation();\n\n\tconst { data, isLoading, isFetched } = useQuery({\n\t\tqueryKey: ['apps', id, 'versions'],\n\t\tqueryFn: async () => {\n\t\t\tconst { apps } = await getVersions();\n\n\t\t\tif (apps.length === 0) {\n\t\t\t\tthrow new Error(t('No_results_found'));\n\t\t\t}\n\t\t\treturn apps;\n\t\t},\n\t\tmeta: {\n\t\t\tapiErrorToastMessage: true,\n\t\t},\n\t});\n\n\treturn (\n\t\t<>\n\t\t\t<Accordion width='100%' alignSelf='center'>\n\t\t\t\t{isLoading && <AccordionLoading />}\n\t\t\t\t{isFetched && <>{data?.map((release) => <AppReleasesItem release={release} key={release.version} />)}</>}\n\t\t\t</Accordion>\n\t\t</>\n\t);\n};\n","sourceCodeStart":4,"sourceCodeEnd":40,"githubUrl":"https://github.com/RocketChat/Rocket.Chat/blob/b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0/apps/meteor/client/views/marketplace/AppDetailsPage/tabs/AppReleases/AppReleases.tsx#L4-L40","documentation":"Client-side synthetic error in the Marketplace app's Releases tab: the useQuery queryFn fetches GET /apps/:id/versions and, when the returned apps array is empty, throws new Error(t('No_results_found')). This converts 'no versions published' into a query error so the UI renders the error state (EmptyState) instead of an empty list; meta.apiErrorToastMessage also toasts it.","triggerScenarios":"Opening an app's Releases tab in the marketplace for an app whose versions list from the Apps-Engine endpoint is empty (unpublished/exploratory app, engine returned no versions, or filtered results).","commonSituations":"Private/sideloaded apps without published versions; marketplace sync glitches returning empty arrays; newly listed apps before versions propagate.","solutions":["Treat it as an expected empty state: this is informational, not a failure — no fix needed if the app genuinely has no releases.","Verify via GET /api/apps/:id/versions that the array is really empty.","Re-sync the marketplace (Admin > Marketplace) if versions are missing unexpectedly.","For sideloaded apps, ensure the app.json version info is valid so versions are listed."],"exampleFix":"// before\nif (apps.length === 0) {\n  throw new Error(t('No_results_found'));\n}\n\n// after (optional UX refactor): render empty state instead of throwing\nif (apps.length === 0) {\n  return [];\n}\n// then render <EmptyState title={t('No_results_found')} /> when data?.length === 0","handlingStrategy":"fallback","validationCode":"const { apps } = await getVersions();\nif (apps.length === 0) {\n  // render the 'no releases' empty state; skip the error path\n}","typeGuard":null,"tryCatchPattern":"try { ... } catch (e) { if ((e as Error).message === t('No_results_found')) { /* expected: app has no published versions */ return; } throw e; }","preventionTips":["Treat empty version lists as valid empty states, not errors.","Sync the marketplace when versions seem missing.","For sideloaded apps, keep valid version metadata in app.json."],"tags":["rocket-chat","marketplace","react-query","apps-engine"],"backgroundTag":"empty-result-set","analyzedSha":"b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0","analyzedAt":"2026-08-18T15:26:39.429Z","schemaVersion":2},"datasetVersion":"2026-08-21T13:17:26.733Z"}