Some final updates to get tests passing again, issue with publisher tenant ID being the 'unique' format which cannot actually be used.
This commit is contained in:
parent
b6f14a3f55
commit
b4e6cbce7a
|
@ -65,6 +65,7 @@ const getCurrentIdentity = async (): Promise<Identity> => {
|
|||
hosting,
|
||||
installationId,
|
||||
tenantId,
|
||||
realTenantId: context.getTenantId(),
|
||||
environment,
|
||||
}
|
||||
} else if (identityType === IdentityType.USER) {
|
||||
|
|
|
@ -20,7 +20,7 @@ export default class DocumentUpdateProcessor implements EventProcessor {
|
|||
properties: any,
|
||||
timestamp?: string | number
|
||||
) {
|
||||
const tenantId = identity.tenantId
|
||||
const tenantId = identity.realTenantId
|
||||
const docId = getDocumentId(event, properties)
|
||||
if (!tenantId || !docId) {
|
||||
return
|
||||
|
|
|
@ -2,8 +2,13 @@ import userGroupProcessor from "./syncUsers"
|
|||
import { docUpdates } from "@budibase/backend-core"
|
||||
|
||||
export type UpdateCallback = (docId: string) => void
|
||||
let started = false
|
||||
|
||||
export function init(updateCb?: UpdateCallback) {
|
||||
if (started) {
|
||||
return
|
||||
}
|
||||
const processors = [userGroupProcessor(updateCb)]
|
||||
docUpdates.init(processors)
|
||||
started = true
|
||||
}
|
||||
|
|
|
@ -20,6 +20,8 @@ function updateCb(docId: string) {
|
|||
}
|
||||
}
|
||||
|
||||
init(updateCb)
|
||||
|
||||
function waitForUpdate(opts: { group?: boolean }) {
|
||||
return new Promise<void>((resolve, reject) => {
|
||||
const timeout = setTimeout(() => {
|
||||
|
@ -35,7 +37,6 @@ function waitForUpdate(opts: { group?: boolean }) {
|
|||
|
||||
beforeAll(async () => {
|
||||
app = await config.init("syncApp")
|
||||
init(updateCb)
|
||||
})
|
||||
|
||||
async function createUser(email: string, roles: UserRoles, builder?: boolean) {
|
||||
|
|
|
@ -46,6 +46,8 @@ export interface Identity {
|
|||
environment: string
|
||||
installationId?: string
|
||||
tenantId?: string
|
||||
// usable - no unique format
|
||||
realTenantId?: string
|
||||
hostInfo?: HostInfo
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue