Commit graph

368 commits

Author SHA1 Message Date
HeroBlackInk
c14180deb7 fix: convertLegacyIds 失败时继续执行,不终止缓存重建 2026-02-18 13:51:00 +08:00
HeroBlackInk
e52e5cb551 fix: extractLabelsFromLine 不过滤 #todoist 标签,支持中文和连字符 2026-02-18 13:24:23 +08:00
HeroBlackInk
11fa5eb175 fix: 修复 databaseChecker 中 todoistStatus 缺少 || false 保护 2026-02-18 13:09:22 +08:00
HeroBlackInk
5b40545c6e fix: Todoist API 返回的 checked 字段替代 isCompleted 2026-02-18 12:46:04 +08:00
HeroBlackInk
e04e1c3a57 fix: 修复 rebuildCache 中 updateTaskIdInVault 使用错误的 filepath 2026-02-18 12:26:58 +08:00
HeroBlackInk
a54d56f309 fix: hasTodoistLink 只匹配包含 todoist.com 的链接 2026-02-18 12:02:28 +08:00
HeroBlackInk
c64d562b55 fix: 添加混合格式链接正则 todoist.com/app/task/xxx 2026-02-18 11:57:39 +08:00
HeroBlackInk
3029d62903 refactor: 删除 extractTaskContent,改用 taskParser.getTaskContentFromLineText 2026-02-18 11:48:36 +08:00
HeroBlackInk
314472f1df refactor: 移除冲突自动处理,仅记录冲突日志 2026-02-18 11:40:12 +08:00
HeroBlackInk
63d80d27fc docs: 添加 cacheOperation.ts 详细注释 2026-02-18 11:23:36 +08:00
HeroBlackInk
fac76b38d4 Update databaseChecker.ts
remove unused function "fetchTodoistsTasks"
2026-02-18 10:54:29 +08:00
HeroBlackInk
668adb043a docs: 添加 databaseChecker.ts 详细注释
- 添加文件级别的整体说明注释
- 为所有接口定义添加详细的属性说明
- 为每个方法添加 JSDoc 注释,说明功能、参数和返回值
- 为关键逻辑添加详细的步骤说明
- 为 8 种数据组合情况添加表格说明
- 为报告生成逻辑添加详细注释
2026-02-18 10:40:45 +08:00
HeroBlackInk
695a31e285 feat: 添加 legacy ID 转换时更新 vault 文件的功能
- backupOperation.ts: 修改备份文件夹名称为 .ultimate-todoist-backup
- fileOperation.ts: 新增 updateTaskIdInVault 函数用于更新 vault 中的任务 ID
- todoistToObsidian.ts: 备份文件名添加 todoist-data 前缀
2026-02-17 19:50:10 +08:00
HeroBlackInk
003bff97b3 fix: 修复 task content 提取正则并改用 content 比对转换 legacy ID
- taskParser.ts: 修复 Todoist 链接正则 [.*?] 错误匹配 checkbox 的问题
- taskParser.ts: 修复 REMOVE_TAGS 正则无法匹配中文紧跟标签的问题
- cacheOperation.ts: 使用 taskParser.getTaskContentFromLineText 替代自定义函数
- cacheOperation.ts: 新增 rebuildCache 中使用 content 比对转换 legacy ID
- databaseChecker.ts: 使用 taskParser 替代自定义 extractTaskContent 函数
- todoistSyncAPI.ts: 重写 convertLegacyIds 用 content 比对替代失效的 API
2026-02-17 19:48:40 +08:00
HeroBlackInk
ac849a8709 Fix: add sync lock check to closeTask and repoenTask 2026-02-17 16:55:45 +08:00
HeroBlackInk
1fee95c5ee Update CHANGELOG with three-way sync feature 2026-02-17 16:50:48 +08:00
HeroBlackInk
630272ff67 Add three-way sync direction controls
- Add obsidianToTodoistEnabled (default: true) and todoistToObsidianEnabled (default: false) settings
- Modify checkAndHandleSyncLock to accept direction parameter
- Update all 11 call sites with appropriate direction values
- Add UI toggles for both new settings in settings tab
- Update sync status display to show direction states
2026-02-17 16:50:28 +08:00
HeroBlackInk
cf20fe75ba release: v1.0.4 - databaseChecker rewrite and report format update 2026-02-17 16:24:54 +08:00
HeroBlackInk
b9c0a339cf fix: update report format in databaseChecker
- Report now saved to vault root directory
- First table shows all 8 data source combinations
- Each issue type now has detailed task information below
2026-02-17 16:23:40 +08:00
HeroBlackInk
3e6db70de9 refactor: rewrite databaseChecker for new architecture
- Check 8 combinations of 3 data sources (Vault, Todoist, taskFileMapping)
- New issue types: mapping_file_not_found, mapping_task_not_in_todoist, mapping_orphan, vault_task_no_mapping, line_number_mismatch
- Removed old issue types: missing_in_cache, file_reference_missing, orphaned_in_cache, cache_content_outdated, cache_status_outdated, duedate_mismatch, empty_metadata
- Updated compareThreeSources to validate taskFileMapping validity
- Added getTodoistTasksFromSyncData method
- Updated generateReport with new summary fields
2026-02-17 16:18:34 +08:00
HeroBlackInk
726f36f7cc fix: ensure syncData is loaded in databaseChecker
- loadCacheTasks() now checks if syncData is loaded before using it
- Returns empty map if syncData is not available
2026-02-17 15:59:32 +08:00
HeroBlackInk
6c4aef5dc9 release: bump version to 1.0.4
Added:
- Full syncDataCache persistence (complete API response)
- Comprehensive test suite for TodoistSyncAPI

Changed:
- Removed syncToken from settings
- Improved mergeSyncData for all API fields
- Refactored rebuildCache for new architecture
2026-02-17 15:57:01 +08:00
HeroBlackInk
4258c2d1c6 refactor: update rebuildCache to use taskFileMapping
- Remove references to todoistTasksData (deprecated)
- Clear taskFileMapping instead of todoistTasksData/fileMetadata
- Ensure syncData is loaded before rebuilding
- Use setTaskFileMapping instead of appendTaskToCache
- Use GetTaskById instead of getTaskById
- Simplify conflict resolution (no cache update needed)
2026-02-17 15:54:13 +08:00
HeroBlackInk
65ea5ef7c7 fix: merge all API response fields in incremental sync
- Replace hardcoded field merging with dynamic approach
- Now handles all fields: projects, items, sections, labels, notes,
  sections_order, project_states, user, settings, etc.
- Uses ID-based merging for arrays, direct replacement for objects
- Properly handles is_deleted flag for all array types
2026-02-17 15:37:57 +08:00
HeroBlackInk
ab44eab11c refactor: remove syncToken from settings, read from syncData instead
- Remove syncToken from UltimateTodoistSyncSettings interface
- Remove syncToken from DEFAULT_SETTINGS
- Read sync_token from syncData (memory) instead of settings
- Sync token is now only stored in memory within syncDataCache
2026-02-17 15:34:07 +08:00
HeroBlackInk
1702ae8950 feat: persist complete syncData to settings
- Add syncDataCache field to settings to store raw API response
- Change syncData type to Record<string, any> to hold complete API response
- Add loadFromCache() method to load cached data on startup
- Save syncData to cache after full sync and incremental sync
- On startup, try loading from cache first before full sync
2026-02-17 15:26:36 +08:00
HeroBlackInk
8b970dd70d docs: update changelog with v1.0.3 refactoring changes 2026-02-17 15:12:40 +08:00
HeroBlackInk
e828aff2a9 refactor: deprecate old cache methods and simplify todoistToObsidian
- taskParser.ts: replace loadTaskFromCacheyID with todoistSyncAPI.GetTaskById
- todoistToObsidian.ts: simplify to use taskFileMapping instead of old cache methods
- cacheOperation.ts: deprecate old cache methods (make them no-ops), keep taskFileMapping methods
2026-02-17 15:11:17 +08:00
HeroBlackInk
c17953bb57 refactor: replace cacheOperation project methods with todoistSyncAPI
- taskParser.ts: replace getProjectNameByIdFromCache/getProjectIdByNameFromCache with todoistSyncAPI.getProjectById/getProjectByName
- databaseChecker.ts: replace todoistTasksData.tasks with syncData.items + taskFileMapping, update project lookup
- modal.ts: replace todoistTasksData.projects with todoistSyncAPI.getSyncData().projects
- settings.ts: replace cacheOperation project methods with todoistSyncAPI.getSyncData()
- cacheOperation.ts: update getDefaultProjectNameForFilepath to use todoistSyncAPI
2026-02-17 15:00:58 +08:00
HeroBlackInk
839a58d01c refactor: start data architecture refactoring - replace todoistTasksData with taskFileMapping
- Remove todoistTasksData from settings, add taskFileMapping
- Modify GetAllProjects/GetTaskById/GetActiveTasks to read from syncData
- Add getProjectById/getProjectByName methods to todoistSyncAPI
- Add taskFileMapping methods to cacheOperation (get/set/delete/getAll)
- Replace cacheOperation calls in obsidianToTodoist.ts
- Replace loadTaskFromCacheyID calls in fileOperation.ts

Build verified successfully.
2026-02-17 14:50:59 +08:00
HeroBlackInk
af039a800f fix: replace fetch with requestUrl and fix getPluginPath for client header
- Replace all fetch() calls with Obsidian's requestUrl() to fix CORS issues
- Fix DeviceManager.getPluginPath() to use vault.configDir instead of getBasePath()
- Ensure X-Todoist-Client header is properly sent with device ID
- Update CHANGELOG with fix details
2026-02-17 13:13:27 +08:00
HeroBlackInk
05b92a04f9 feat: migrate REST API to Sync API to fix CORS errors
- Add temp_id support to Sync API addTask method
- Add compatible wrapper methods (AddTask, UpdateTask, CloseTask, etc.)
- Replace all todoistRestAPI calls with todoistSyncAPI
- Create comprehensive test suite for migration validation
- Test results: 43/48 tests pass, all core CRUD operations work

Migration complete - Sync API can replace REST API.
2026-02-16 13:10:10 +08:00
HeroBlackInk
d7b4167468 fix: improve sync status display and check order - show blocked status when user enables sync with database issues 2026-02-16 12:26:40 +08:00
HeroBlackInk
097aa8a795 fix: correct sync status display order - show database issues first 2026-02-16 12:16:42 +08:00
HeroBlackInk
d79e9c09e0 fix: update sync control settings - default to false, integrate with existing Check Database button 2026-02-16 12:11:49 +08:00
HeroBlackInk
d83ebf1e46 feat: add database sync control module with auto-check on startup 2026-02-16 12:02:51 +08:00
HeroBlackInk
9dfc1da230 fix: simplify folder creation with error handling 2026-02-16 11:41:45 +08:00
HeroBlackInk
ba43f33cf8 fix: handle folder already exists error 2026-02-16 11:37:58 +08:00
HeroBlackInk
4dc0ba861b fix: improve notification messages for report generation status 2026-02-16 11:34:28 +08:00
HeroBlackInk
a85cbcbcb3 fix: update regex to match task IDs with hyphens 2026-02-16 11:32:53 +08:00
HeroBlackInk
6f8858f2f7 fix: add detailed error logging for report generation 2026-02-16 11:27:40 +08:00
HeroBlackInk
7657e502d9 refactor: remove duplicate checkDatabase code from cacheOperation 2026-02-16 10:28:48 +08:00
HeroBlackInk
a68940f12d refactor: extract checkDatabase to separate databaseChecker module 2026-02-16 10:03:33 +08:00
HeroBlackInk
c35f7eaafb chore: update changelog with detailed 3-way comparison info 2026-02-16 05:37:42 +08:00
HeroBlackInk
f723102ded feat: implement 3-way comparison in checkDatabase (Vault, Cache, Todoist) 2026-02-16 05:36:26 +08:00
HeroBlackInk
621f73527a refactor: checkDatabase now fetches fresh data from Todoist API 2026-02-16 05:24:46 +08:00
HeroBlackInk
91cf03fb10 chore: update changelog for v1.0.2 2026-02-16 05:14:57 +08:00
HeroBlackInk
1702fcb65d feat: enhance database check report with detailed task information 2026-02-16 05:13:41 +08:00
HeroBlackInk
48894a0744 feat: generate markdown report for database check results 2026-02-16 05:10:35 +08:00
HeroBlackInk
def443a65d chore: update changelog for v1.0.2 2026-02-16 05:05:32 +08:00