obsidian-tasks: Querying for "today" doesn't update when the date changes and the machine was asleep (Chrome bug)

Expected Behavior

When the date changes (i.e. I leave Obsidian open overnight), I’d expect tasks with queries with lines like due on today to refresh automatically and show me tasks that are due today (like they do when you add a new task).

Current behaviour

These queries don’t refresh automatically; they show me stale data (e.g. an empty list) until I put the cursor over them (to show the source) and move the cursor away again (so I’ve developed a habit of putting the cursor at the top of my “tasks to do” document and holding the down arrow key until it reaches the end every morning, just to make sure I’m seeing the things that are actually scheduled today or due today or whatever).

Steps to reproduce

Sample query:

not done
(scheduled on today) OR (due on today)
show urgency
hide task count

Just add a task that’s due tomorrow, wait 24 hours, and observe that the task doesn’t appear in the query until you interact with it.

Which Operating Systems are you using?

  • Android
  • iPhone/iPad
  • Linux
  • macOS
  • Windows

Obsidian Version

1.0.3

Tasks Plugin Version

1.17.0

Checks

  • I have tried it with all other plugins disabled and the error still occurs

Possible solution

I assume this just happens because “noticing when the date changes” isn’t implemented (hence not testing without other plugins, because I don’t want to bother if this is known to not work) – there are some UI challenges with this, obviously if you finish a task at 11:59pm you don’t want a task list to be jumping around as you’re trying to click the checkbox, but it would be really nice if nothing else to have e.g. an item in the command palette for “refresh all tasks views now” (like Dataview does), or for stale task lists to refresh when the window loses focus, or something.

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Reactions: 2
  • Comments: 20

Most upvoted comments

😃 Maybe it will be.

I was just basically adding information in case someone else used multiple windows frequently. Absolutely not something that falls into Tasks responsibility. I’ve gotten pretty good at remembering to refresh on each machine every day to insure I don’t miss things. If I couldn’t remember, I’d simply add a task to my daily note to remind me.

@AaronOldenburg if you have a daily note system, you might consider adding it as a task each day.

@claremacrae I didn’t know about the Reload app without saving command. TY. That will make it faster.

Unfortunately, and not related to Tasks, Obsidian doesn’t remember which virtual desktops which windows are open on so you still have to rearrange them on each machine each day or each app reload. Which could require some very OS/OS Flavor dependent code. That said, on two of my three main machines, the app reload will work great!

@donthorp - also, there seems to be a requirement in your description that a refresh command would leave the window positions unchanged… you should make such things clear in the new ticket, if you choose to submit one.

If clearing your index and state was possible, like on startup, having that in the command palette would help in situations like this.

I wondered if that was what you meant, having seen a similar command in dataview recently.

If you would like it to be tracked for consideration, please do log it as a feature request. Please be sure to explain the motivation there, so it’s self-contained… (I mean, not saying that you would, but please don’t assume or require that anyone reading the new ticket should need to separately pick through all the discussion here…)

Wow - thank you for this.

you could massively reduce the redraw interval (e.g. redraw every 5 minutes rather than just at midnight), but that’s frustratingly inefficient.

That did give me a different idea though… Check every 5 minutes if the day has changed since the last check… And only redraw if the day has changed.

It means that if you wake up a machine that was asleep overnight, the tasks will redraw within 5 minutes, which may still be too slow, but would it be enough of an improvement???

I will update the summary line to reflect what you learned.