Merge branch 'develop' of github.com:Budibase/budibase into feature/BUDI-7052

This commit is contained in:
mike12345567 2023-07-18 11:33:28 +01:00
commit af5d024d89
4 changed files with 20 additions and 14 deletions

View File

@ -98,7 +98,7 @@
"koa2-ratelimit": "1.1.1", "koa2-ratelimit": "1.1.1",
"lodash": "4.17.21", "lodash": "4.17.21",
"memorystream": "0.3.1", "memorystream": "0.3.1",
"mongodb": "5.6", "mongodb": "5.7",
"mssql": "9.1.1", "mssql": "9.1.1",
"mysql2": "2.3.3", "mysql2": "2.3.3",
"node-fetch": "2.6.7", "node-fetch": "2.6.7",

View File

@ -5,7 +5,7 @@ import {
generateApiKey, generateApiKey,
getChecklist, getChecklist,
} from "./utilities/workerRequests" } from "./utilities/workerRequests"
import { installation, tenancy, logging, events } from "@budibase/backend-core" import { events, installation, logging, tenancy } from "@budibase/backend-core"
import fs from "fs" import fs from "fs"
import { watch } from "./watch" import { watch } from "./watch"
import * as automations from "./automations" import * as automations from "./automations"

View File

@ -1,6 +1,6 @@
import authorized from "../middleware/authorized" import authorized from "../middleware/authorized"
import { BaseSocket } from "./websocket" import { BaseSocket } from "./websocket"
import { permissions, events } from "@budibase/backend-core" import { permissions, events, context } from "@budibase/backend-core"
import http from "http" import http from "http"
import Koa from "koa" import Koa from "koa"
import { import {
@ -15,7 +15,7 @@ import {
import { gridSocket } from "./index" import { gridSocket } from "./index"
import { clearLock, updateLock } from "../utilities/redis" import { clearLock, updateLock } from "../utilities/redis"
import { Socket } from "socket.io" import { Socket } from "socket.io"
import { BuilderSocketEvent, GridSocketEvent } from "@budibase/shared-core" import { BuilderSocketEvent } from "@budibase/shared-core"
export default class BuilderSocket extends BaseSocket { export default class BuilderSocket extends BaseSocket {
constructor(app: Koa, server: http.Server) { constructor(app: Koa, server: http.Server) {
@ -35,7 +35,13 @@ export default class BuilderSocket extends BaseSocket {
userIdMap[session._id] = true userIdMap[session._id] = true
} }
}) })
const tenantId = context.getTenantIDFromAppID(appId)
if (tenantId) {
await context.doInTenant(tenantId, async () => {
await events.user.dataCollaboration(Object.keys(userIdMap).length) await events.user.dataCollaboration(Object.keys(userIdMap).length)
})
}
// Reply with all current sessions // Reply with all current sessions
callback({ users: sessions }) callback({ users: sessions })

View File

@ -8820,10 +8820,10 @@ bson@*:
resolved "https://registry.yarnpkg.com/bson/-/bson-5.0.1.tgz#4cd3eeeabf6652ef0d6ab600f9a18212d39baac3" resolved "https://registry.yarnpkg.com/bson/-/bson-5.0.1.tgz#4cd3eeeabf6652ef0d6ab600f9a18212d39baac3"
integrity sha512-y09gBGusgHtinMon/GVbv1J6FrXhnr/+6hqLlSmEFzkz6PodqF6TxjyvfvY3AfO+oG1mgUtbC86xSbOlwvM62Q== integrity sha512-y09gBGusgHtinMon/GVbv1J6FrXhnr/+6hqLlSmEFzkz6PodqF6TxjyvfvY3AfO+oG1mgUtbC86xSbOlwvM62Q==
bson@^5.3.0: bson@^5.4.0:
version "5.3.0" version "5.4.0"
resolved "https://registry.yarnpkg.com/bson/-/bson-5.3.0.tgz#37b006df4cd91ed125cb686467c1dd6d4606b514" resolved "https://registry.yarnpkg.com/bson/-/bson-5.4.0.tgz#0eea77276d490953ad8616b483298dbff07384c6"
integrity sha512-ukmCZMneMlaC5ebPHXIkP8YJzNl5DC41N5MAIvKDqLggdao342t4McltoJBQfQya/nHBWAcSsYRqlXPoQkTJag== integrity sha512-WRZ5SQI5GfUuKnPTNmAYPiKIof3ORXAF4IRU5UcgmivNIon01rWQlw5RUH954dpu8yGL8T59YShVddIPaU/gFA==
buffer-alloc-unsafe@^1.1.0: buffer-alloc-unsafe@^1.1.0:
version "1.1.0" version "1.1.0"
@ -19067,12 +19067,12 @@ mongodb-connection-string-url@^2.6.0:
"@types/whatwg-url" "^8.2.1" "@types/whatwg-url" "^8.2.1"
whatwg-url "^11.0.0" whatwg-url "^11.0.0"
mongodb@5.6: mongodb@5.7:
version "5.6.0" version "5.7.0"
resolved "https://registry.yarnpkg.com/mongodb/-/mongodb-5.6.0.tgz#caff5278341bfc0f1ef6f394bb403d207de03d1e" resolved "https://registry.yarnpkg.com/mongodb/-/mongodb-5.7.0.tgz#e16d2fcdfd9f8503ec2d88288392dc3235bb3ecc"
integrity sha512-z8qVs9NfobHJm6uzK56XBZF8XwM9H294iRnB7wNjF0SnY93si5HPziIJn+qqvUR5QOff/4L0gCD6SShdR/GtVQ== integrity sha512-zm82Bq33QbqtxDf58fLWBwTjARK3NSvKYjyz997KSy6hpat0prjeX/kxjbPVyZY60XYPDNETaHkHJI2UCzSLuw==
dependencies: dependencies:
bson "^5.3.0" bson "^5.4.0"
mongodb-connection-string-url "^2.6.0" mongodb-connection-string-url "^2.6.0"
socks "^2.7.1" socks "^2.7.1"
optionalDependencies: optionalDependencies: