Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Found duplicates in MetaData #110

Open
funkymonkeymonk opened this issue Apr 9, 2024 · 11 comments
Open

Found duplicates in MetaData #110

funkymonkeymonk opened this issue Apr 9, 2024 · 11 comments

Comments

@funkymonkeymonk
Copy link

Describe the bug
I have a very large list of duplicates in metadata which causes the popup to overflow. This makes it difficult to resolve the issue.

To Reproduce
Steps to reproduce the behavior:

  1. Create a large number of metadata duplicates
  2. Attempt to sync

Expected behavior
A clear and concise output telling me what I need to do to find and fix the error

Screenshots
Screenshot 2024-04-09 at 7 22 36 PM

Desktop (please complete the following information):

  • OS: OSX

Additional context
After looking at the source, the current message does not actually give much help in terms of resolving the issue. I don't understand what caused the metadata to be duplicated and there is no duplicates in the file so I presume that the actual issue I need to fix is more complicated. My hope is that in reporting the display bug additional debugging/troubleshooting steps will be more apparent.

I suspect this may also be because I move tasks between projects regularly because I use the time sector system.

@thesamim
Copy link
Owner

Display issue noted. Will do something about it in the fullness of time.

I suspect this may also be because I move tasks between projects regularly because I use the time sector system.

Your suspicion is spot on.

About moving tasks around:

  1. Are you moving them in TickTick or are you moving them in Obsidian?
  2. The notes that you are moving them to/from: Do they have a default project set?
  3. Are you limiting the syncing by tag or by folder?

A depiction of your workflow would also be helpful.

@funkymonkeymonk
Copy link
Author

  1. I'm moving them in TickTick.
  2. I'm not moving them in notes.
  3. No I am not.

My workflow is entirely in ticktick. You can imagine projects like the following:
image

I move tasks from my someday project to my this month, or from next week to this week based on when I want to do them. I only use obsidian because I want to keep a record of what I accomplished in a given day in my daily note so I use a dataview query to parse through all of ticktick folder and show tasks that are completed on that day.

@thesamim
Copy link
Owner

Thanks for the clarification.
I've got a number of crises in progress at the moment. Will look into the issue ASAP.

To make sure I understand:
The desired outcome is that you want the tasks in your daily notes, and only your daily notes. And when you move them in TickTick, you really don't want them moved in Obsidian, just tracked there.

Is that right?

The immediate solution, btw, would be to have a note per project in Obsidian and set the default project for each of those notes to match the correspondingly named project in TickTick. If all you're doing in your daily note is a dataview query, that should ought to work for you. The side effect, though, is that the tasks will move between notes in Obsidian as well.

@funkymonkeymonk
Copy link
Author

Thanks for the clarification.
I've got a number of crises in progress at the moment. Will look into the issue ASAP.

This is an open source project and not critical to my work flow. I'm in no rush. I'm a developer myself so feel free to spitball ideas and I'm happy to try to run them down in my free time as well.

To make sure I understand:
The desired outcome is that you want the tasks in your daily notes, and only your daily notes. And when you move them in TickTick, you really don't want them moved in Obsidian, just tracked there.

Pretty much. Like I'd be happy if the sync just put it into one big file that I could use as a database then query with Dataview in the relevant places. That feels like a more extensible solution to me but may run into it's own problems that I don't know of.

The immediate solution, btw, would be to have a note per project in Obsidian and set the default project for each of those notes to match the correspondingly named project in TickTick. If all you're doing in your daily note is a dataview query, that should ought to work for you. The side effect, though, is that the tasks will move between notes in Obsidian as well.

This is exactly what I'm doing. I have a Monthly.md which lives in a directory in my root folder called ticktick and is where the problem is occurring. You can see that in the original screen shot. I genuinely have no clue why it's finding Duplicates in the metadata. Here is a snippet of that file.

- [ ] Check for router updates  [link](https://ticktick.com/webapp/#p/65963cbad010d1780f4b5c72/tasks/660b3b470943d10603a254f8) #ticktick  %%[ticktick_id:: 660b3b470943d10603a254f8]%% 📅 2024-05-01

I'm not sure what to do to fix the metadata problem.

@thesamim
Copy link
Owner

I'm not sure what to do to fix the metadata problem.

If Debug Mode is on, I believe you will get a more informative layout what duplicates are where in the console. I'm pretty sure I left that logging in there.

in your favorite editor, open <your vault>\.obsidian\plugins\TickTickSync\data.json

Search for task ID: 660b3b470943d10603a254f8 (Obviously: repeat for duplicated tasks.)

you will see all the files TickTickSync thinks that task is in under the fileMetadata entry.

Delete all the entries from the files it shouldn't be in.

While you're in there, please check that the defaultProjectId for your various notes are what you expect them to be. You can look up the projectId in the projects entry.

@funkymonkeymonk
Copy link
Author

So I found 2 copies of the task data as well as 3 references to the same task in the same fileMetadata entry. I'm wondering does the sync job lock the data.json?

@funkymonkeymonk
Copy link
Author

So I tried deleting the duplicates and they got put back. I need to put this down for today but I'll dig in later and see if I can figure out what's happening.

@thesamim
Copy link
Owner

I'm wondering does the sync job lock the data.json?

If you mean TickTickSync syncing, yes it does. Or do you mean Obsidian's Sync?

If you are comfortable doing so: send me your data.json at thesamim gmail com (redacting any sensitive information in task titles of course.) I'd like to take a look at your structure....

@funkymonkeymonk
Copy link
Author

Will do. Let me vet it then I'll send something over.

@rblundon
Copy link

@thesamim

The immediate solution, btw, would be to have a note per project in Obsidian and set the default project for each of those notes to match the correspondingly named project in TickTick.

I don't see how to accomplish this in the settings.

I am trying to accomplish the same thing -> Create tasks in any file with #ticktick tag to sync, then assign them to a list/project in TickTick. I'm fine with the task moving around in the project files, but on the next sync I get the duplicate task error because the task is no longer in my default project.

I think the workaround I am going to temporarily going to implement is to use additional tags to identify the project and leave all the tasks in the default project in TickTick.

@thesamim
Copy link
Owner

I don't see how to accomplish this in the settings.

Let's say you have a list called project a in TickTick.

Let's say you have a file called project a (it can be any name really) in Obsidian.

Go to the project a file in Obsidian and open the command palette (Ctrl-p in windows, or there are several other ways.) Look for TickTickSync: Set default TickTick project for Tasks in the current file in the commands. Click on that. You will be presented with a dialog that will let you select the TickTick List you want this file to be a default for....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants