Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workaround to avoid false-positive version warning #6656

Merged
merged 3 commits into from
Nov 23, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ For upgrade instructions, please check the [migration guide](MIGRATIONS.released
### Fixed
- Fixed a bug in the dataset import view, where the layer name text field would lose focus after each key press. [#6615](https://github.com/scalableminds/webknossos/pull/6615)
- Fixed importing NGFF Zarr datasets with non-scale transforms. [#6621](https://github.com/scalableminds/webknossos/pull/6621)
- Fixed a regression in NGFF Zarr import for datasets with no channel axis. [#6636](https://github.com/scalableminds/webknossos/pull/6636)<<<<<<< task-creation-nml
- Fixed a regression in NGFF Zarr import for datasets with no channel axis. [#6636](https://github.com/scalableminds/webknossos/pull/6636)
- Fixed broken creation of tasks using base NMLs. [#6634](https://github.com/scalableminds/webknossos/pull/6634)
- Fixed false-positive warning about an outdated annotation version. [#6656](https://github.com/scalableminds/webknossos/pull/6656)

### Removed

Expand Down
19 changes: 19 additions & 0 deletions frontend/javascripts/oxalis/model/sagas/save_saga.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1147,6 +1147,25 @@ function* watchForSaveConflicts() {
tracing.type,
);

// There is a rare chance of a race condition happening
// which can result in an incorrect toast warning.
// It occurs if certain saga effects run in the following order:
// 1) a new version is pushed to the server (in sendRequestToServer)
// 2) the current server version is fetched (in this saga here)
// 3) the server version is compared with the client version (in this saga here)
// 4) only now is the local version number updated because the
// sendRequestToServer saga was scheduled now.
// Since (4) is happening too late, the comparison in (3) will assume
// that client and server are out of sync.
// The chance of this happening is relatively low, but from time to time it
// happened. To mitigate this problem, we introduce a simple sleep here which
// means that the chance of (4) being scheduled after (2) should be close to
// 0 (hopefully).
// Note that a false-positive warning in this saga doesn't have serious side-effects
// (except for potentially confusing the user). This is why a more complex mutex- or
// semaphore-based solution to this problem was not chosen.
yield* call(sleep, 2000);

// Read the tracing version again from the store, since the
// old reference to tracing might be outdated now due to the
// immutability.
Expand Down