Skip to content

Commit

Permalink
fix: issue with non en-US date/time representation causing parsing er…
Browse files Browse the repository at this point in the history
…rors (#81)

fix: edge case where tasks were not getting closed properly on checkbox click
closes #64
update changelog
  • Loading branch information
thesamim authored Mar 15, 2024
1 parent 5bdad10 commit 7319ce9
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 48 deletions.
90 changes: 52 additions & 38 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,45 +1,18 @@
## CHANGELOG

### prelease \[1.0.3\] - 2023-11-09

Initial Beta.

TickTick API implemented.
See Readme file for known issues.

### Beta one \[1.0.4\]

First announcement. Functionality implemented.
See Readme file for known issues.

### Beta one \[1.0.5\]

Fixed:

1. Projects were only being synced on start up
2. If a task in a new project was created in TickTic, File Metadata was not being updated correctly.
3. Task open/close update was unduly delayed.
4. Mark as a destktop only app.
### Beta five \[1.0.18\] -- \[1.0.19]

### Beta one \[1.0.6\]

Review change requests implemented. No funtionality change.

### Beta two \[1.0.7\]
1. TickTickSync is now mobile compatible
2. Remove dependency on ticktick-api-lvt, migrate all API code to TickTickSync source tree
3. Fix issue with non en-US date/time representation causing parsing errors
4. Prevent unwanted task moves between files
5. Prevent duplication of tasks
6. Warn on duplicate tasks. Prevent syncing if there are any
7. Correct status checking
8. Correct status changing
9. Prevent task deletion on false positive of content disappearing.
10. Rationalize error handling.

Further Review Change requests implemented. No funtionality change.

### Beta three \[1.0.8\]

1. TickTick Task description will no longer be over-written
2. Obsidian URL added to Task Title instead of over-writing description
3. Bi-Directional sync of Task Items
4. Accommodate ALL versions of Task markdown.
5. Bug Fix: ALL TickTick side modifications will sync.
6. Only allow a Project to be default for one single file. (limitation of current task sync)
7. Confirm ALL Task Deletes!
8. Introduce Login flow because TickTick periodically requires a captcha login.
9. Credentials no longer stored in data file.

### Beta four \[1.0.9\] -- \[1.0.17\]

Expand All @@ -57,3 +30,44 @@ Further Review Change requests implemented. No funtionality change.
12. Allow default project to be removed from file
13. Add Project and Parent move functionality
14. Fix backlinks being removed from task

### Beta three \[1.0.8\]

1. TickTick Task description will no longer be over-written
2. Obsidian URL added to Task Title instead of over-writing description
3. Bi-Directional sync of Task Items
4. Accommodate ALL versions of Task markdown.
5. Bug Fix: ALL TickTick side modifications will sync.
6. Only allow a Project to be default for one single file. (limitation of current task sync)
7. Confirm ALL Task Deletes!
8. Introduce Login flow because TickTick periodically requires a captcha login.
9. Credentials no longer stored in data file.

### Beta two \[1.0.7\]

Further Review Change requests implemented. No funtionality change.

### Beta one \[1.0.6\]

Review change requests implemented. No funtionality change.

### Beta one \[1.0.5\]

Fixed:

1. Projects were only being synced on start up
2. If a task in a new project was created in TickTic, File Metadata was not being updated correctly.
3. Task open/close update was unduly delayed.
4. Mark as a destktop only app.

### Beta one \[1.0.4\]

First announcement. Functionality implemented.
See Readme file for known issues.

### prelease \[1.0.3\] - 2023-11-09

Initial Beta.

TickTick API implemented.
See Readme file for known issues.
2 changes: 1 addition & 1 deletion dist/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "tickticksync",
"name": "TickTickSync",
"version": "1.0.18",
"version": "1.0.19",
"minAppVersion": "1.0.0",
"description": "Sync TickTick tasks to Obsidian, and Obsidian tasks to TickTick",
"author": "thesamim",
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "tickticksync",
"name": "TickTickSync",
"version": "1.0.18",
"version": "1.0.19",
"minAppVersion": "1.0.0",
"description": "Sync TickTick tasks to Obsidian, and Obsidian tasks to TickTick",
"author": "thesamim",
Expand Down
13 changes: 5 additions & 8 deletions src/fileOperation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ import {App, Notice, TFile, TFolder} from 'obsidian';
import TickTickSync from "../main";
import { ITask } from './api/types/Task';
import {TaskDeletionModal} from "./modals/TaskDeletionModal";
import { Status } from 'obsidian-task/src/Statuses/Status';
import { StatusType } from 'obsidian-task/src/Statuses/StatusConfiguration';


export class FileOperation {
app: App;
Expand Down Expand Up @@ -431,9 +430,6 @@ export class FileOperation {
if (line.includes(taskId) && this.plugin.taskParser?.hasTickTickTag(line)) {
let newTaskContent = await this.plugin.taskParser?.convertTaskToLine(task);

//TODO: Possibly redundant.
let bOldTaskOpen = this.plugin.taskParser?.isTaskOpen(line)

//get tabs for current task
let parentTabs = this.plugin.taskParser?.getTabs(line);
let itemCount = 0;
Expand All @@ -446,7 +442,8 @@ export class FileOperation {
lines.splice(i+1,currentTask.items.length)
}
lines[i] = parentTabs + line.replace(line, newTaskContent)
if ((bOldTaskOpen) && (task.status != 0)) {
//always add completion date at end if the task is closed.
if (task.status != 0) {
//in an ideal world, we would triger Tasks to complete the task for us.
//but we're not there. Slap a completion date on the end of the line and be done
lines[i] = this.plugin.taskParser?.addCompletionDate(lines[i], task.completedTime);
Expand Down Expand Up @@ -693,7 +690,7 @@ export class FileOperation {
}


private async moveChildTasks(newTask: ITask, toBeProcessed: string[], filepath: Promise<string | string>) {
private async moveChildTasks(newTask: ITask, toBeProcessed: string[], filepath: string) {
for (const childId of newTask.childIds) {
//Are they going to be processed later?
if (toBeProcessed.includes(childId)) {
Expand All @@ -716,7 +713,7 @@ export class FileOperation {
}
}

private async moveTask(filepath: Promise<string | string>, task: ITask, oldtaskItemNum: number, oldTaskId: string, oldProjectId: string) {
private async moveTask(filepath: string, task: ITask, oldtaskItemNum: number, oldTaskId: string, oldProjectId: string) {
await this.deleteTaskFromSpecificFile(filepath, task.id, task.title, oldtaskItemNum, false);
await this.plugin.cacheOperation?.deleteTaskFromCache(oldTaskId);

Expand Down

0 comments on commit 7319ce9

Please sign in to comment.