mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-22 09:11:13 -05:00
Improve error handling and dependency checks for data processing
Address issues in FieldHistoryDialog by clearing changes on error, enhance useEntityVersions to provide default profiles for missing users, add localStorage availability check in useLocationAutoDetect, and improve dependency resolution logic in supabase/functions/process-selective-approval. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 334e80ad-8f74-4e3a-acec-6dd811858e98 Replit-Commit-Checkpoint-Type: intermediate_checkpoint
This commit is contained in:
@@ -318,9 +318,10 @@ function topologicalSort(items: any[]): any[] {
|
||||
|
||||
if (item.depends_on) {
|
||||
const parent = items.find(i => i.id === item.depends_on);
|
||||
if (parent) {
|
||||
visit(parent);
|
||||
if (!parent) {
|
||||
throw new Error(`Missing dependency: item ${item.id} depends on ${item.depends_on} which is not in the submission`);
|
||||
}
|
||||
visit(parent);
|
||||
}
|
||||
|
||||
visiting.delete(item.id);
|
||||
|
||||
Reference in New Issue
Block a user