fix(idaa): harden data sync against padStart crashes and fix Archive Content sort

- Hardened object processors in Archives and Posts modules to safely handle null 'sort' values, preventing runtime TypeErrors during data synchronization.
- Fixed inconsistent sorting in Archive Content list by correctly implementing descending order (sort then reverse) and adding a configuration loading guard to the liveQuery.
- Standardized safe data processing patterns in SVELTE_DEXIE_GUIDE.md.
- Performed minor cleanup and visibility logic hardening in Recovery Meetings module.
This commit is contained in:
Scott Idem
2026-02-05 12:27:26 -05:00
parent bd39fd3061
commit 2306f2d0c4
9 changed files with 104 additions and 63 deletions

View File

@@ -548,11 +548,12 @@ export async function process_ae_obj__post_props({
if (!obj.account_id_random) obj.account_id_random = account_id;
}
obj.name = obj.title;
const sort_val = (obj.sort ?? 0).toString().padStart(3, '0');
obj.tmp_sort_1 = `${obj.group ?? ''}_${obj.priority ? '1' : '0'}_${
obj.sort?.toString().padStart(3, '0') ?? ''
sort_val
}_${obj.updated_on ?? obj.created_on}`;
obj.tmp_sort_2 = `${obj.group ?? ''}_${obj.priority ? '1' : '0'}_${
obj.sort?.toString().padStart(3, '0') ?? ''
sort_val
}_${obj.updated_on}_${obj.created_on}`;
return obj;

View File

@@ -360,11 +360,12 @@ export async function process_ae_obj__post_comment_props({
obj_type: 'post_comment',
log_lvl,
specific_processor: (obj) => {
const sort_val = (obj.sort ?? 0).toString().padStart(3, '0');
obj.tmp_sort_1 = `${obj.group ?? ''}_${obj.priority ? '1' : '0'}_${
obj.sort?.toString().padStart(3, '0') ?? ''
sort_val
}_${obj.updated_on ?? obj.created_on}`;
obj.tmp_sort_2 = `${obj.group ?? ''}_${obj.priority ? '1' : '0'}_${
obj.sort?.toString().padStart(2, '0') ?? ''
(obj.sort ?? 0).toString().padStart(2, '0')
}_${obj.updated_on}_${obj.created_on}`;
return obj;