keybase / keybase/client

Keybase emits error notifcations when user tests existence of non-existent directory

Open
#25,531 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
9.2k
Forks
1.3k
Avg merge
12h 58m
Merged PRs (30d)
56

Description

I'm using Keybase 6.0.2 on Pop!_OS 22.04, a Linux distribution downstream from Ubuntu (and Debian). My desktop environment is GNOME.

If I use my shell's built-in `test` command to test the existence of a non-existent directory under `/keybase/private`, I get a GNOME notification saying I don't have read access to the non-existent directory.

For example, if I enter

```sh
test -e /keybase/private/foo
```

I see a GNOME notification saying

> Keybase: Access denied
> russellhanneken does not have read access to /keybase/private/foo

Since `foo` doesn't exist, I guess it's true I don't have read access to it, but I didn't expect a noisy error message informing me of that fact.

I've reproduced this issue with the built-in `test` command in Zsh 5.8.1 and Bash 5.1.16, and also with the `test` command that comes with GNU coreutils 8.32.

I first noticed the problem when I started using [zsh-syntax-highlighting](https://github.com/zsh-users/zsh-syntax-highlighting). zsh-syntax-highlighting tries to let the user know when s/he has typed a path incorrectly on the command line; if a typed path refers to an existing file or directory—or is at least the beginning characters of a valid path—it underlines the user's input. If the user types a character that makes it impossible for the input to refer to a real file or directory, the underline is removed.

The implementation of this feature involves invoking the Zsh `test` command repeatedly as the user is typing. In particular there are [these two lines](https://github.com/zsh-users/zsh-syntax-highlighting/blob/0.7.1/highlighters/main/main-highlighter.zsh#L1031-L1032).

Because Keybase emits notifications when non-existent directories are tested for existence, this means the zsh-syntax-highlighting results in a lot of notification noise while I'm in the process of typing a valid path (but before I've finished typing).

E.g., the path `/keybase/private/russellhanneken` exists. But between the time I've typed `/keybase/private/` and the time I've typed the final `n` in `russellhanneken`, I sure see a lot of notification noise.

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the notification with `test -e /keybase/private/foo` on the reported GNOME setup, then trace the Keybase client path that handles filesystem access-denied notifications. Done means testing a non-existent path no longer produces a notification, while genuine access errors still do.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
desktop, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.