fix: get rid of NOTIFY_INBOX_ONLY env variable (#6592)

This commit is contained in:
Alexander Onnikov 2024-09-17 07:32:53 +07:00 committed by GitHub
parent fada0c4718
commit 17e1013213
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 8 additions and 7 deletions

3
.vscode/launch.json vendored
View File

@ -128,10 +128,9 @@
"MINIO_ACCESS_KEY": "minioadmin",
"MINIO_SECRET_KEY": "minioadmin",
"MINIO_ENDPOINT": "localhost",
"MODEL_VERSION": "v0.6.286",
"MODEL_VERSION": "v0.6.286"
// "INIT_SCRIPT_URL": "https://raw.githubusercontent.com/hcengineering/init/main/script.yaml",
// "INIT_WORKSPACE": "onboarding",
"NOTIFY_INBOX_ONLY": "true"
},
"runtimeVersion": "20",
"runtimeArgs": ["--nolazy", "-r", "ts-node/register"],

View File

@ -110,7 +110,6 @@ services:
- MODEL_ENABLED=*
- ACCOUNTS_URL=http://host.docker.internal:3000
- BRANDING_PATH=/var/cfg/branding.json
- NOTIFY_INBOX_ONLY=true
# - PARALLEL=2
# - INIT_SCRIPT_URL=https://raw.githubusercontent.com/hcengineering/init/main/script.yaml
# - INIT_WORKSPACE=onboarding

View File

@ -75,7 +75,6 @@ services:
- MODEL_ENABLED=*
- ACCOUNTS_URL=http://account:3003
- BRANDING_PATH=/var/cfg/branding.json
- NOTIFY_INBOX_ONLY=true
restart: unless-stopped
front:
image: hardcoreeng/front

View File

@ -200,7 +200,7 @@ export async function isShouldNotifyTx (
const result = new Map<Ref<NotificationProvider>, BaseNotificationType[]>()
let providers: NotificationProvider[] = control.modelDb.findAllSync(notification.class.NotificationProvider, {})
if (process.env.NOTIFY_INBOX_ONLY === 'true') {
if (getMetadata(serverNotification.metadata.InboxOnlyNotifications) === true) {
providers = providers.filter((it) => it._id === notification.providers.InboxNotificationProvider)
}

View File

@ -151,7 +151,8 @@ export default plugin(serverNotificationId, {
metadata: {
SesUrl: '' as Metadata<string>,
PushPrivateKey: '' as Metadata<string>,
PushSubject: '' as Metadata<string>
PushSubject: '' as Metadata<string>,
InboxOnlyNotifications: '' as Metadata<boolean>
},
class: {
NotificationProviderResources: '' as Ref<Class<NotificationProviderResources>>

View File

@ -54,6 +54,7 @@
"@hcengineering/server-pipeline": "^0.6.0",
"@hcengineering/server-client": "^0.6.0",
"@hcengineering/server-token": "^0.6.11",
"@hcengineering/server-notification": "^0.6.1",
"@hcengineering/analytics": "^0.6.0"
}
}

View File

@ -25,6 +25,7 @@ import {
import { type MigrateOperation } from '@hcengineering/model'
import { setMetadata } from '@hcengineering/platform'
import serverClientPlugin from '@hcengineering/server-client'
import serverNotification from '@hcengineering/server-notification'
import serverToken from '@hcengineering/server-token'
import toolPlugin from '@hcengineering/server-tool'
import { WorkspaceWorker } from './service'
@ -100,6 +101,8 @@ export function serveWorkspaceAccount (
}
setMetadata(serverClientPlugin.metadata.UserAgent, 'WorkspaceService')
setMetadata(serverNotification.metadata.InboxOnlyNotifications, true)
const worker = new WorkspaceWorker(
version,
txes,

View File

@ -70,7 +70,6 @@ services:
- MODEL_ENABLED=*
- ACCOUNTS_URL=http://account:3003
- BRANDING_PATH=/var/cfg/branding.json
- NOTIFY_INBOX_ONLY=true
restart: unless-stopped
front:
image: hardcoreeng/front