Skip to content

Commit 5978c07

Browse files
authored
Merge pull request #7321 from TheThingsNetwork/fix/top-devices-leak
Fix device ID check for top devices in the app overview
2 parents 4d8571b + 1e688e7 commit 5978c07

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ For details about compatibility between different releases, see the **Commitment
1919

2020
### Fixed
2121

22+
- Potential leak of end devices of other (owned) applications in the top end devices panel in the application overview of the Console.
23+
2224
### Security
2325

2426
## [3.32.1] - unreleased

pkg/webui/console/containers/top-entities-dashboard-panel/top-devices/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,10 @@ import { selectEndDeviceTopEntities } from '@console/store/selectors/top-entitie
3131
import EntitiesList from '../list'
3232

3333
const TopDevicesList = ({ appId }) => {
34-
const topEntityFilter = useMemo(() => (appId ? e => e.id.startsWith(appId) : undefined), [appId])
34+
const topEntityFilter = useMemo(
35+
() => (appId ? e => e.id.split('/')[0] === appId : undefined),
36+
[appId],
37+
)
3538
const items = useSelector(state => selectEndDeviceTopEntities(state, topEntityFilter))
3639

3740
const headers = [

0 commit comments

Comments
 (0)