Skip to content

Commit

Permalink
Merge pull request #7321 from TheThingsNetwork/fix/top-devices-leak
Browse files Browse the repository at this point in the history
Fix device ID check for top devices in the app overview
  • Loading branch information
kschiffer authored Oct 6, 2024
2 parents 4d8571b + 1e688e7 commit 5978c07
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ For details about compatibility between different releases, see the **Commitment

### Fixed

- Potential leak of end devices of other (owned) applications in the top end devices panel in the application overview of the Console.

### Security

## [3.32.1] - unreleased
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ import { selectEndDeviceTopEntities } from '@console/store/selectors/top-entitie
import EntitiesList from '../list'

const TopDevicesList = ({ appId }) => {
const topEntityFilter = useMemo(() => (appId ? e => e.id.startsWith(appId) : undefined), [appId])
const topEntityFilter = useMemo(
() => (appId ? e => e.id.split('/')[0] === appId : undefined),
[appId],
)
const items = useSelector(state => selectEndDeviceTopEntities(state, topEntityFilter))

const headers = [
Expand Down

0 comments on commit 5978c07

Please sign in to comment.