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:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user