Open ahafri opened 4 months ago
I'm struggling to reproduce this bug, my initial thought is maybe Todoist isn't actually sending the tasks in the API response.
If you enable debug logging from the plugin settings, the raw request/responses will be logged in the developer console - then we can see which tasks are actually returned by Todoist.
Are you able to reliably reproduce this with that specific query & project setup?
You're right, Todoist isn't returning those tasks in the API response. Yet the same query works fine in the app proper (i.e., it returns from the sub-projects). I am kind of at a loss.
Is there a way for me to directly test different queries in the console?
There's a very roundabout way by reaching into the internals of the system!
First you need to register a subscription:
const [_, refresh] = app.plugins.plugins['todoist-sync-plugin'].services.todoist.subscribe("##Test", (tasks) => console.log(tasks))
Then call the refresh callback to trigger the API call and then log to the console:
refresh()
This is asynchronous, so the tasks will appear a short while after you press enter
OK, I just installed the latest plugin version (1.13.0), and the API call now gives me the requested data (it wasn't before, with plugin version 1.11.1). The query retrieved in the console and what's shown in the Obsidian note are in line with one another, so the issue appears to be that the query itself does not return all the tasks that it should, based on the filter (whereas in the Todoist app itself, the same query does).
I think I pinpointed the issue: The plugin (at least for me) appears to fail at retrieving tasks that are in sub-projects of sub-projects:
Here's the plugin:
Here's the Todoist app. Notice the additional task ("Email undergrad...") which is under the section "Recruiting" from the "Recruiting and Branding 🆕" project (which itself is under the "Work 🎯" main project):
The missing task ("Email undergrad...") is one embedded at two levels of projects: "Work 🎯" > "Set Up Research 🔬" > "Recruiting and Branding 🆕". When I put the very same task one project up (in "Set Up Research 🔬") so it's just one level under the main project, the plugin succeeds at retrieving it.
the API call now gives me the requested data (it wasn't before, with plugin version 1.11.1)
I take this to mean the code snippet I gave you didn't work until you updated? If so, yeah that's expected - sorry I missed you were on an old version! I rewrote the querying backend between those versions 😅
so the issue appears to be that the query itself does not return all the tasks that it should, based on the filter [...] I think I pinpointed the issue: The plugin (at least for me) appears to fail at retrieving tasks that are in sub-projects of sub-projects
This is great - thanks for tracing this down. I'll try and repro this myself, but regardless I'll raise an issue with Todoist (I don't work there and this is just an unofficial plugin) to try and get the API response fixed!
Ah, that's great! Didn't think about the fact that the issue could be on Todoist's end, but of course, that makes sense. Looking forward to seeing the resolution. (And by the way, I love your plugin; thanks for making it!)
I don't think you'll be able to access this, but for my own future reference - https://get.todoist.help/hc/en-us/requests/831430
Describe the bug When I have a filter for projects and sub-projects (see below), certain tasks in certain sub-projects appear but not in other sub-projects. It does not seem to be related to the title of the project (e.g., whether it contains characters like ":" or emojis). The same filter parameters appear to work fine in the Todoist application.
The filter used is:
To Reproduce I am not sure how to reproduce it. But one attempt could be:
Screenshots
Desktop: Mac OSX Sonoma 14.3.1