Skip to content

fix(dashlane-plugin): don't hang forever on a locked vault (bound dcli calls, add onLocked option) - #959

Closed
anuragbanerjee wants to merge 1 commit into
dmno-dev:mainfrom
anuragbanerjee:dashlane-locked-vault
Closed

fix(dashlane-plugin): don't hang forever on a locked vault (bound dcli calls, add onLocked option)#959
anuragbanerjee wants to merge 1 commit into
dmno-dev:mainfrom
anuragbanerjee:dashlane-locked-vault

Conversation

@anuragbanerjee

Copy link
Copy Markdown
Contributor

Problem

dashlane("dl://...") resolves by spawning dcli read <uri> with piped stdio and no timeout. On a locked Dashlane vault, dcli prompts for the master password on a pipe that never answers, so the child never exits and any varlock load / varlock run whose schema contains a dashlane() entry hangs forever. This includes @optional entries the current command doesn't even need.

Repro:

dcli lock
varlock load --skip-cache   # schema with any dashlane() item: hangs forever

Changes

  1. stdin closed on every dcli spawn (--version, sync, read): interactive prompts hit EOF and fail immediately instead of blocking.
  2. Spawn timeout on every dcli call as a backstop: default 30s, configurable via @initDashlane(timeoutMs=...). A timeout maps to the existing "Dashlane vault appears locked or not synced" ResolutionError with an actionable tip.
  3. New @initDashlane(onLocked=error|warn) option, default error (current behavior). With warn, the locked-vault error is thrown with warning severity, so @optional dashlane() items resolve empty with a surfaced warning and the load still passes; @required items still hard fail via EmptyRequiredValueError.

Behavior on a locked vault with onLocked=warn:

Item Before After
@optional + dashlane() hangs resolves empty with a warning
@required + dashlane() hangs fails fast with a clear error
non-dashlane items hangs resolve normally

With the default onLocked=error, everything fails fast with the locked-vault error instead of hanging.

Small core change

VarlockError already supports warning severity, but ConfigItem.resolve() bailed on any resolution error before the required/optional check, so a warning-severity resolution error would have let @required items pass with only a warning. The bail now applies only to error-severity resolution errors: a warning-severity error leaves the value empty and normal required/optional handling takes over. Nothing in core currently throws warning-severity resolution errors, so this only affects plugins that opt in.

Tests

New locked vault handling tests drive the existing fake dcli shim with new misbehavior modes: a blocked master-password prompt fails immediately (stdin closed), a hung call fails within timeoutMs, the onLocked=warn matrix above, and schema validation of the new options. Full dashlane plugin suite and varlock core suite pass, typecheck clean on both packages.

Docs updated in the plugin README and the website plugins page.

…i calls, add onLocked option)

On a locked vault, dcli prompts for the master password on a pipe that
never answers, so any load whose schema contains a dashlane() entry hung
forever, even for optional items the current command doesn't need.

- run every dcli call with stdin closed so interactive prompts hit EOF
  and fail immediately instead of blocking
- add a spawn timeout to every dcli call as a backstop (default 30s,
  configurable via @initDashlane(timeoutMs=...)); timeouts map to the
  existing locked-vault ResolutionError
- add @initDashlane(onLocked=error|warn), default error. With warn, the
  locked-vault error is thrown as a warning so optional dashlane() items
  resolve empty and the load can still pass; required items still fail
  as empty
- varlock core: warning-severity resolution errors no longer skip
  required/optional handling (previously they bypassed the required
  check entirely)
@theoephraim

theoephraim commented Aug 7, 2026

Copy link
Copy Markdown
Member

Thanks for this. Closing in favour of #989. I cherry picked some of this work, so you'll still get attribution.

Instead we add an allowMissing option to individual items and as an instance wide default. The idea being that if you wire up an item, it usually is expected to exist.

I'm not sold on coupling required/optional to any kind of resolution failure. Also not so sure about only warning on a locked vault. If you want to be able to resolve the schema in different situations (with the dashlane items or without) you should be able to use functions to do that, and explicitly attempt to load them or not.

@theoephraim theoephraim closed this Aug 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants