alphapapa / alphapapa/org-ql

Caching issues with relative time predicates

Aberta
#115 1 comentário 0 reações 1 responsável Reivindicada por @alphapapa Ver no GitHub
bug
Linguagem predominante
Emacs Lisp
Estrelas
1.6k
Forks
120
Métricas de merge de PRs
Nenhum PR com merge em 30d

Descrição

Time-based predicates in org-ql interact poorly with the built-in caching behavior. Consider the predicate `'(scheduled :to today)`. If I open up emacs and run this query (in my personal workflow, via an org-ql-view), it works just fine. However, if that emacs instance stays open until tomorrow, the query results will be stale unless something else (an edit in an agenda file, for example) invalidates the cache).

My own workflow is only minimally affected by this at the moment, since I was primarily noticing this in one of my `org-ql-views`. So I replaced something like this
```elisp
'("Scheduled up to today"
:title "Scheduled up to today"
:buffers-files org-agenda-files
:query (scheduled :to today))
```
with something like this
```elisp
(cons "Scheduled up to today"
(lambda ()
(interactive)
(org-ql-search (org-agenda-files)
`(scheduled :to ,(format-time-string "%Y-%m-%d"))
:title "Scheduled up to today")))
```
However, this does seem like a more general problem.

Some thoughts/suggestions on how this could be resolved:
- Detect when relative time predicates' meanings have changed and invalidate the cache accordingly
- Resolve relative time values in queries to absolute time values some time before caching (essentially a more general version of what I did above)

Guia de contribuição

Nenhum guia de contribuição indexado para este repositório

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.