Skip to content

Commit

Permalink
🐛 fix(metrics API): remove unexistant fields in users table (#150)
Browse files Browse the repository at this point in the history
  • Loading branch information
rezk2ll authored Dec 11, 2024
1 parent 7dce966 commit 0c8a035
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 12 deletions.
2 changes: 0 additions & 2 deletions packages/tom-server/src/metrics-api/services/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,6 @@ class MetricsService implements IMetricsService {
try {
const queryResult = (await this.matrixDb.getAll('users', [
'name',
'displayname',
'avatar_url',
'creation_ts',
'last_seen_ts'
])) as unknown as MatrixUserInfo[]
Expand Down
8 changes: 0 additions & 8 deletions packages/tom-server/src/metrics-api/tests/controller.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,33 +12,25 @@ const ONE_WEEK_IN_MS = 7 * ONE_DAY_IN_MS
const ONE_MONTH_IN_MS = 30 * ONE_DAY_IN_MS

const TODAY_USER = {
avatar_url: '',
creation_ts: 1,
displayname: 'user 1',
last_seen_ts: new Date().getTime(),
name: 'user1'
} satisfies MatrixUserInfo

const PRE_TODAY_USER = {
avatar_url: '',
creation_ts: 1,
displayname: 'user 1',
last_seen_ts: new Date().getTime() - ONE_DAY_IN_MS - 1,
name: 'user2'
}

const PRE_WEEK_USER = {
avatar_url: '',
creation_ts: 1,
displayname: 'user 2',
last_seen_ts: new Date().getTime() - ONE_WEEK_IN_MS - 1,
name: 'user3'
}

const PRE_MONTH_USER = {
avatar_url: '',
creation_ts: 1,
displayname: 'user 3',
last_seen_ts: new Date().getTime() - ONE_MONTH_IN_MS - 1,
name: 'user4'
}
Expand Down
2 changes: 0 additions & 2 deletions packages/tom-server/src/metrics-api/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ export interface UserActivityStats {

export interface MatrixUserInfo {
name: string
displayname: string
avatar_url: string
last_seen_ts: number
creation_ts: number
}
Expand Down

0 comments on commit 0c8a035

Please sign in to comment.