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,
|
hosting,
|
||||||
installationId,
|
installationId,
|
||||||
tenantId,
|
tenantId,
|
||||||
|
realTenantId: context.getTenantId(),
|
||||||
environment,
|
environment,
|
||||||
}
|
}
|
||||||
} else if (identityType === IdentityType.USER) {
|
} else if (identityType === IdentityType.USER) {
|
||||||
|
|
|
@ -20,7 +20,7 @@ export default class DocumentUpdateProcessor implements EventProcessor {
|
||||||
properties: any,
|
properties: any,
|
||||||
timestamp?: string | number
|
timestamp?: string | number
|
||||||
) {
|
) {
|
||||||
const tenantId = identity.tenantId
|
const tenantId = identity.realTenantId
|
||||||
const docId = getDocumentId(event, properties)
|
const docId = getDocumentId(event, properties)
|
||||||
if (!tenantId || !docId) {
|
if (!tenantId || !docId) {
|
||||||
return
|
return
|
||||||
|
|
|
@ -2,8 +2,13 @@ import userGroupProcessor from "./syncUsers"
|
||||||
import { docUpdates } from "@budibase/backend-core"
|
import { docUpdates } from "@budibase/backend-core"
|
||||||
|
|
||||||
export type UpdateCallback = (docId: string) => void
|
export type UpdateCallback = (docId: string) => void
|
||||||
|
let started = false
|
||||||
|
|
||||||
export function init(updateCb?: UpdateCallback) {
|
export function init(updateCb?: UpdateCallback) {
|
||||||
|
if (started) {
|
||||||
|
return
|
||||||
|
}
|
||||||
const processors = [userGroupProcessor(updateCb)]
|
const processors = [userGroupProcessor(updateCb)]
|
||||||
docUpdates.init(processors)
|
docUpdates.init(processors)
|
||||||
|
started = true
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,6 +20,8 @@ function updateCb(docId: string) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
init(updateCb)
|
||||||
|
|
||||||
function waitForUpdate(opts: { group?: boolean }) {
|
function waitForUpdate(opts: { group?: boolean }) {
|
||||||
return new Promise<void>((resolve, reject) => {
|
return new Promise<void>((resolve, reject) => {
|
||||||
const timeout = setTimeout(() => {
|
const timeout = setTimeout(() => {
|
||||||
|
@ -35,7 +37,6 @@ function waitForUpdate(opts: { group?: boolean }) {
|
||||||
|
|
||||||
beforeAll(async () => {
|
beforeAll(async () => {
|
||||||
app = await config.init("syncApp")
|
app = await config.init("syncApp")
|
||||||
init(updateCb)
|
|
||||||
})
|
})
|
||||||
|
|
||||||
async function createUser(email: string, roles: UserRoles, builder?: boolean) {
|
async function createUser(email: string, roles: UserRoles, builder?: boolean) {
|
||||||
|
|
|
@ -46,6 +46,8 @@ export interface Identity {
|
||||||
environment: string
|
environment: string
|
||||||
installationId?: string
|
installationId?: string
|
||||||
tenantId?: string
|
tenantId?: string
|
||||||
|
// usable - no unique format
|
||||||
|
realTenantId?: string
|
||||||
hostInfo?: HostInfo
|
hostInfo?: HostInfo
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue