Update standard fields (#6532)

In this PR:
- adding Favorites to Tasks and Notes
- fixing inconsistencies between custom object creation and sync of
standard fields of custom objects
- fixing workspaceCacheVersion not used to invalidate existing
datasource
This commit is contained in:
Charles Bochet
2024-08-04 23:22:41 +02:00
committed by GitHub
parent 03204021cb
commit 2b311b5f7b
14 changed files with 112 additions and 40 deletions

View File

@ -26,20 +26,20 @@ export class WorkspaceDatasourceFactory {
public async create(
workspaceId: string,
cacheVersion: string | null,
workspaceSchemaVersion: string | null,
): Promise<WorkspaceDataSource> {
const desiredCacheVersion =
cacheVersion ??
const desiredWorkspaceSchemaVersion =
workspaceSchemaVersion ??
(await this.workspaceCacheVersionService.getVersion(workspaceId));
if (!desiredCacheVersion) {
if (!desiredWorkspaceSchemaVersion) {
throw new Error('Cache version not found');
}
const latestCacheVersion =
const latestWorkspaceSchemaVersion =
await this.workspaceCacheVersionService.getVersion(workspaceId);
if (latestCacheVersion !== desiredCacheVersion) {
if (latestWorkspaceSchemaVersion !== desiredWorkspaceSchemaVersion) {
throw new Error('Cache version mismatch');
}
@ -70,7 +70,7 @@ export class WorkspaceDatasourceFactory {
}
const workspaceDataSource = await workspaceDataSourceCacheInstance.execute(
`${workspaceId}-${cacheVersion}`,
`${workspaceId}-${latestWorkspaceSchemaVersion}`,
async () => {
const dataSourceMetadata =
await this.dataSourceService.getLastDataSourceMetadataFromWorkspaceId(