Skip to content

Scheduled tasks with repeater don't show on agenda when overdue #372

@omar-nelson-hernandez

Description

@omar-nelson-hernandez

Describe the bug

Whenever you have a scheduled task with a repeater like:

* TODO Pay CC test
  SCHEDULED: <2022-06-14 Tue ++1m>

  some test

and the scheduled date is in the past, the reminder only appears in the agenda on the given scheduled date, if the task is not completed it won't appear in future days in the agenda, like it used to do.

Steps to reproduce

A single scheduled task, with a schedule date in the past and a repeater (around a month, for some reason it works as expected with short repeaters like ++1h or ++3d but not ++1m), like:

* TODO Pay CC test
  SCHEDULED: <2022-06-14 Tue ++1m>

  some test

Opening the agenda will show something like this:

Thursday   14 July 2022
  art:        Scheduled: TODO drawabox.com
  test:       Scheduled: TODO Pay CC test
Friday     15 July 2022
  art:        Scheduled: TODO drawabox.com
Saturday   16 July 2022
  art:        Scheduled: TODO drawabox.com

No reminders after the item is overdue, only on the due date.

Strangely the issue doesn't happen with shorter repeaters, like:

* TODO Pay CC test
  SCHEDULED: <2022-06-14 Tue ++1h>

  some test

The items are correctly displayed in the agenda:

Wednesday  20 July 2022
  art:        Scheduled: TODO drawabox.com
  test:       Scheduled: TODO Pay CC test
Thursday   21 July 2022
  desktop:    16:20...... TODO polybar
  server:     Sched. 96x: TODO [#B] Fix server fan noise
  desktop:    Sched. 44x: TODO polybar
  art:        Scheduled:  TODO drawabox.com
  test:       Scheduled:  TODO Pay CC test
Friday     22 July 2022
  art:        Scheduled: TODO drawabox.com
  test:       Scheduled: TODO Pay CC test

Expected behavior

The TODO item should appear on the agenda every day from the time it became overdue until it is marked as complete (and the due date is updated because of the repeater)

Emacs functionality

The reminders in the agenda appear there until the item is completed or the due date moved, as per: https://orgmode.org/manual/Repeated-tasks.html

Minimal init.lua

vim.cmd([[set runtimepath=$VIMRUNTIME]])
vim.cmd([[set packpath=/tmp/nvim/site]])

local package_root = '/tmp/nvim/site/pack'
local install_path = package_root .. '/packer/start/packer.nvim'

local function load_plugins()
  require('packer').startup({
    {
      'wbthomason/packer.nvim',
      { 'nvim-treesitter/nvim-treesitter' },
      { 'kristijanhusak/orgmode.nvim', branch = 'master' },
    },
    config = {
      package_root = package_root,
      compile_path = install_path .. '/plugin/packer_compiled.lua',
    },
  })
end

_G.load_config = function()
  require('orgmode').setup_ts_grammar()
  require('nvim-treesitter.configs').setup({
    highlight = {
      enable = true,
      additional_vim_regex_highlighting = { 'org' },
    },
  })

  vim.cmd([[packadd nvim-treesitter]])
  vim.cmd([[runtime plugin/nvim-treesitter.lua]])
  vim.cmd([[TSUpdateSync org]])

  -- Close packer after install
  if vim.bo.filetype == 'packer' then
    vim.api.nvim_win_close(0, true)
  end

  require('orgmode').setup()

  -- Reload current file if it's org file to reload tree-sitter
  if vim.bo.filetype == 'org' then
    vim.cmd([[edit!]])
  end
end

if vim.fn.isdirectory(install_path) == 0 then
  vim.fn.system({ 'git', 'clone', 'https://github.com/wbthomason/packer.nvim', install_path })
  load_plugins()
  require('packer').sync()
  vim.cmd([[autocmd User PackerCompileDone ++once lua load_config()]])
else
  load_plugins()
  load_config()
end

require('orgmode').setup_ts_grammar()

require('orgmode').setup({
  org_agenda_files = '/storage/notebook/org/*',
  org_default_notes_file = '/storage/notebook/org/refile.org',
  org_todo_keywords = {'TODO(t)', 'BLOCKED(b)', '|', 'DONE(d)'},
  org_time_stamp_rounding_minutes = 1,
  org_priority_default = 'C'
})

Screenshots and recordings

No response

OS / Distro

Debian 10

Neovim version/commit

NVIM v0.8.0-dev-nightly-5-g1f1863ed5

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions