Skip to content
This repository has been archived by the owner on May 25, 2022. It is now read-only.

bw sync reports as successful even when server is unreachable #129

Closed
fredrikekre opened this issue Apr 16, 2020 · 1 comment · Fixed by #190
Closed

bw sync reports as successful even when server is unreachable #129

fredrikekre opened this issue Apr 16, 2020 · 1 comment · Fixed by #190
Assignees

Comments

@fredrikekre
Copy link
Contributor

bw sync reports as successful even when server is unreachable. In contrast, the Firefox browser plugin instead gives an error message Syncing failed as expected.

Might be the same root cause as #12 but this is for a very different reason so opening a new issue.

Here is a reproducible example (using bitwarden_rs as a server, but should be irrelevant).

$ docker run -d --name bitwarden -p 8000:80 bitwardenrs/server
57acead31b52fca12a5fd8b803c048c2c6e35c20d936afa00c57747446afc81c

$ bw config server http://localhost:8000
Saved setting `config`.

Create a dummy user from the browser and login

$ bw login
[...]

$ export BW_SESSION="..."

Syncing works as expected

$ bw sync
Syncing complete.

$ bw sync --last
2020-04-16T14:55:33.112Z

Now shut down the server

$ docker stop bitwarden 
bitwarden

and yet bw sync reports succesful syncing, but checking last sync time verifies that it wasn't actually syncing.

$ bw sync
Syncing complete.                     # <--- ???

$ bw sync --last
2020-04-16T14:55:33.112Z

Version:

$ bw --version
1.9.1
@fredrikekre
Copy link
Contributor Author

Stumbled upon this again; still present with

$ bw --version
1.13.2

fredrikekre added a commit to fredrikekre/jslib that referenced this issue Nov 20, 2020
…Sync

The motivation for this is bitwarden/cli#129
where failed sync's are swallowed by try-catch. By moving the try-catch
to the outside it is possible to reuse the already existing
allowThrowOnError argument which callers can use to signal whether
fullSync should throw or ignore errors silently. This patch is
companioned with a patch to the SyncCommand CLI command to pass
allowThrowOnError.
fredrikekre added a commit to fredrikekre/cli that referenced this issue Nov 20, 2020
This intends to make explicit calls to bw sync
throw if the syncing can not be performed,
fixes bitwarden#129.
fredrikekre added a commit to fredrikekre/jslib that referenced this issue Nov 20, 2020
…Sync

The motivation for this is bitwarden/cli#129
where failed sync's are swallowed by try-catch. By moving the try-catch
to the outside it is possible to reuse the already existing
allowThrowOnError argument which callers can use to signal whether
fullSync should throw or ignore errors silently. This patch is
companioned with a patch to the SyncCommand CLI command to pass
allowThrowOnError.
cscharf pushed a commit to bitwarden/jslib that referenced this issue Nov 23, 2020
…Sync (#207)

The motivation for this is bitwarden/cli#129
where failed sync's are swallowed by try-catch. By moving the try-catch
to the outside it is possible to reuse the already existing
allowThrowOnError argument which callers can use to signal whether
fullSync should throw or ignore errors silently. This patch is
companioned with a patch to the SyncCommand CLI command to pass
allowThrowOnError.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants