Refactor: Add microtask yields to journals module for consistency

Added await Promise.resolve() yields after IndexedDB writes to ensure
Dexie observers fire before function returns. Aligns with pattern
established in event loaders fix.

Journals module was already working correctly (preserved try_cache),
but adding yields ensures consistent timing behavior across all
nested data loading patterns.
This commit is contained in:
Scott Idem
2026-02-26 13:42:27 -05:00
parent 3849118fec
commit 32f8a75373

View File

@@ -152,6 +152,8 @@ async function _refresh_journal_id_background({
properties_to_save,
log_lvl
});
// Yield to microtask queue so Dexie liveQuery observers fire before we return
await Promise.resolve();
}
if (inc_entry_li) {
result.journal_entry_li = await load_ae_obj_li__journal_entry({
@@ -338,6 +340,8 @@ async function _refresh_journal_li_background({
properties_to_save,
log_lvl
});
// Yield to microtask queue so Dexie liveQuery observers fire before we return
await Promise.resolve();
}
if (inc_entry_li) {
for (const journal of results) {