Skip to content

Commit dbee2f3

Browse files
authored
Fix model txes order (#9626)
Signed-off-by: Denis Bykhov <[email protected]>
1 parent f326e35 commit dbee2f3

File tree

1 file changed

+1
-16
lines changed

1 file changed

+1
-16
lines changed

server/postgres/src/storage.ts

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2053,12 +2053,7 @@ class PostgresTxAdapter extends PostgresAdapterBase implements TxAdapter {
20532053
})
20542054

20552055
const model = res.map((p) => parseDoc<Tx>(p, getSchema(DOMAIN_MODEL_TX)))
2056-
// We need to put all core.account.System transactions first
2057-
const systemTx: Tx[] = []
2058-
const userTx: Tx[] = []
2059-
2060-
model.forEach((tx) => (tx.modifiedBy === core.account.System && !isPersonAccount(tx) ? systemTx : userTx).push(tx))
2061-
return this.stripHash(systemTx.concat(userTx)) as Tx[]
2056+
return this.stripHash(model) as Tx[]
20622057
}
20632058
}
20642059
function prepareJsonValue (tkey: string, valType: string): { tlkey: string, arrowCount: number } {
@@ -2121,13 +2116,3 @@ export async function createPostgresTxAdapter (
21212116
'tx' + wsIds.url
21222117
)
21232118
}
2124-
2125-
function isPersonAccount (tx: Tx): boolean {
2126-
return (
2127-
(tx._class === core.class.TxCreateDoc ||
2128-
tx._class === core.class.TxUpdateDoc ||
2129-
tx._class === core.class.TxRemoveDoc) &&
2130-
((tx as TxCUD<Doc>).objectClass === 'contact:class:PersonAccount' ||
2131-
(tx as TxCUD<Doc>).objectClass === 'contact:class:EmployeeAccount')
2132-
)
2133-
}

0 commit comments

Comments
 (0)