Skip to content

Commit

Permalink
Workaround to avoid false-positive version warning (#6656)
Browse files Browse the repository at this point in the history
* implement workaround to avoid false-positive version warning

* update changelog
  • Loading branch information
philippotto authored Nov 23, 2022
1 parent 11f42ae commit 0b5c1f9
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,12 @@ 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)
- Fixed broken creation of tasks using base NMLs. [#6634](https://github.com/scalableminds/webknossos/pull/6634)
- 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 that the precomputation of meshes didn't take the active mapping into account. [#6651](https://github.com/scalableminds/webknossos/pull/6651)
- 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

0 comments on commit 0b5c1f9

Please sign in to comment.