Big improvements in UX for tabletop actions

This commit is contained in:
ThaumRystra
2025-01-24 16:13:36 +02:00
parent 5b68190570
commit 0b499b9c98
15 changed files with 225 additions and 205 deletions

View File

@@ -27,10 +27,12 @@ export default async function writeActionResults(action: EngineAction) {
content: logContents,
creatureId: action.creatureId,
tabletopId: action.tabletopId,
actionId: action._id,
});
// Write the bulk updates
const bulkWritePromise = bulkWrite(creaturePropUpdates, CreatureProperties);
// Write the bulk updates, force them to sequential mode means we immediately get the results
// in the subscription, rather than waiting for oplog tailing to catch up
const bulkWritePromise = bulkWrite(creaturePropUpdates, CreatureProperties, true);
await Promise.all([engineActionPromise, logPromise, bulkWritePromise]);