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

@@ -472,11 +472,12 @@ export async function process_ae_obj__archive_props({
obj_type: 'archive',
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(3, '0') ?? ''
sort_val
}_${obj.updated_on}_${obj.created_on}`;
return obj;

View File

@@ -384,15 +384,16 @@ export async function process_ae_obj__archive_content_props({
obj_type: 'archive_content',
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.original_datetime ?? ''}`;
obj.tmp_sort_2 = `${obj.group ?? ''}_${obj.original_datetime ?? ''}_${
obj.priority ? '1' : '0'
}_${obj.sort?.toString().padStart(3, '0') ?? ''}`;
}_${sort_val}`;
obj.tmp_sort_3 = `${obj.original_datetime ?? ''}_${obj.group ?? ''}_${
obj.priority ? '1' : '0'
}_${obj.sort?.toString().padStart(3, '0') ?? ''}`;
}_${sort_val}`;
obj.hash_sha256 = obj.hosted_file_hash_sha256;