No description
Find a file
Barrett Ruth 874ff381f9
fix: resolve OAuth re-auth deadlock and sync concurrency races (#88)
* fix(gtasks): prevent concurrent push/pull from racing on the store

Problem: `push` and `pull` both run via `oauth.async`, so issuing them
back-to-back starts two coroutines that interleave at every curl yield.
Both snapshot `build_id_index` before either has mutated the store,
which can cause push to create a remote task that pull would have
recognized as already linked, producing duplicates on Google.

Solution: guard `with_token` with a module-level `_in_flight` flag set
before `oauth.async` is called so no second operation can start during
a token-refresh yield. A `pcall` around the callback guarantees the
flag is always cleared, even on an unexpected error.

* refactor(sync): centralize `with_token` in oauth.lua with shared lock

Problem: `with_token` was duplicated in `gcal.lua` and `gtasks.lua`,
with the concurrency lock added only to the gtasks copy. Any new
backend would silently inherit the same race, and gcal back-to-back
push could still create duplicate remote calendar events.

Solution: lift `with_token` into `oauth.lua` as
`M.with_token(client, name, callback)` behind a module-level
`_sync_in_flight` guard. All backends share one implementation; the
lock covers gcal, gtasks, and any future backend automatically.

* ci: format
2026-03-06 16:09:45 -05:00
.github doc: minify readme (#24) 2026-02-25 09:40:06 -05:00
doc feat(sync): unify Google auth under :Pending auth (#72) 2026-03-05 21:08:22 -05:00
lua/pending fix: resolve OAuth re-auth deadlock and sync concurrency races (#88) 2026-03-06 16:09:45 -05:00
plugin feat: :Pending auth subcommands + fix #61 (#84) 2026-03-06 12:36:47 -05:00
scripts fix: harden sync backends and fix edit recompute (#66) 2026-03-05 11:50:13 -05:00
spec fix(oauth): resolve re-auth deadlock and improve flow robustness (#87) 2026-03-06 15:47:42 -05:00
syntax refactor: adopt markdown-style checkbox buffer format (#20) 2026-02-24 23:21:55 -05:00
.busted build: add tooling and dev environment configs 2026-02-24 15:08:44 -05:00
.editorconfig build: initial repo scaffold 2026-02-24 15:08:35 -05:00
.gitignore fix: harden sync backends and fix edit recompute (#66) 2026-03-05 11:50:13 -05:00
.luarc.json refactor(config): default icons to ascii (#55) 2026-03-04 17:49:30 -05:00
.pre-commit-config.yaml ci: format 2026-02-24 15:17:24 -05:00
flake.lock build: add tooling and dev environment configs 2026-02-24 15:08:44 -05:00
flake.nix ci: nix 2026-03-04 14:07:04 -05:00
LICENSE build: initial repo scaffold 2026-02-24 15:08:35 -05:00
pending.nvim-scm-1.rockspec feat: rename 2026-02-24 15:21:44 -05:00
README.md feat(sync): interactive setup, auth continuation, and credential resolution fixes (#70) 2026-03-05 15:29:32 -05:00
selene.toml build: add tooling and dev environment configs 2026-02-24 15:08:44 -05:00
stylua.toml build: add tooling and dev environment configs 2026-02-24 15:08:44 -05:00
vim.yaml build: add tooling and dev environment configs 2026-02-24 15:08:44 -05:00

pending.nvim

Edit tasks like text. Inspired by oil.nvim, vim-fugitive

demo

Requirements

  • Neovim 0.10+
  • (Optionally) curl for Google Calendar and Google Task sync

Installation

Install with your package manager of choice or via luarocks:

luarocks install pending.nvim

Documentation

:help pending.nvim

Acknowledgements