mirror of
https://github.com/heroblackink/ultimate-todoist-sync-for-obsidian.git
synced 2026-07-22 07:40:27 +00:00
fix(issues): create mapping entry for tasks missing from taskFileMapping in applyDatabaseCheckerIssues
DatabaseChecker detects issues for tasks found in Vault/Todoist but missing from taskFileMapping. applyDatabaseCheckerIssues silently skipped these because ensureClonedEntry returned undefined for missing entries. Now creates a default entry using the issue's filePath, allowing issues to be persisted and visible in Manage Problem Tasks.
This commit is contained in:
parent
0c7ce44e80
commit
ced52a6d9b
1 changed files with 13 additions and 3 deletions
|
|
@ -429,9 +429,19 @@ export class CacheOperation {
|
|||
const clonedEntries = new Set<string>();
|
||||
let changed = false;
|
||||
|
||||
const ensureClonedEntry = (taskId: string): typeof taskFileMapping[string] | undefined => {
|
||||
const ensureClonedEntry = (taskId: string, filePath?: string): typeof taskFileMapping[string] | undefined => {
|
||||
const originalEntry = taskFileMapping[taskId];
|
||||
if (!originalEntry) return undefined;
|
||||
if (!originalEntry) {
|
||||
if (!filePath) return undefined;
|
||||
taskFileMapping[taskId] = {
|
||||
filePath,
|
||||
status: 'active' as const,
|
||||
syncEnabled: true,
|
||||
};
|
||||
clonedEntries.add(taskId);
|
||||
changed = true;
|
||||
return taskFileMapping[taskId];
|
||||
}
|
||||
if (!clonedEntries.has(taskId)) {
|
||||
taskFileMapping[taskId] = {
|
||||
...originalEntry,
|
||||
|
|
@ -444,7 +454,7 @@ export class CacheOperation {
|
|||
|
||||
for (const issue of resultIssues) {
|
||||
if (!issue.taskId) continue;
|
||||
const mappingEntry = ensureClonedEntry(issue.taskId);
|
||||
const mappingEntry = ensureClonedEntry(issue.taskId, issue.filePath);
|
||||
if (!mappingEntry) continue;
|
||||
|
||||
const issueType = normalizeTaskIssueTypeKey(issue.type);
|
||||
|
|
|
|||
Loading…
Reference in a new issue