Skip to content

Commit 6a4b559

Browse files
committed
Merge branch 'master' of github.com:scalableminds/webknossos into account-settings-page
2 parents dd6c8e6 + deaaa2c commit 6a4b559

34 files changed

+315
-356
lines changed

CHANGELOG.unreleased.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ For upgrade instructions, please check the [migration guide](MIGRATIONS.released
1919
### Fixed
2020
- Improved efficiency of saving bounding box related changes. [#8492](https://github.com/scalableminds/webknossos/pull/8492)
2121
- When deleting a dataset, its caches are cleared, so that if a new dataset by the same name is uploaded afterwards, only new data is loaded. [#8638](https://github.com/scalableminds/webknossos/pull/8638)
22+
- Fixed a race condition when starting proofreading with a split action. [#8676](https://github.com/scalableminds/webknossos/pull/8676)
23+
- Fixed that activating a mapping got stuck when a dataset was opened in "view" mode. [#8687](https://github.com/scalableminds/webknossos/pull/8687)
2224

2325
### Removed
2426

MIGRATIONS.unreleased.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,7 @@ User-facing changes are documented in the [changelog](CHANGELOG.released.md).
88
## Unreleased
99
[Commits](https://github.com/scalableminds/webknossos/compare/25.06.1...HEAD)
1010

11+
- The default thread pool size was increased from 5 to 10 times the number of available CPUs (capped at 1000). Note that wk may need slightly more memory because of this. [#8686](https://github.com/scalableminds/webknossos/pull/8686)
12+
1113
### Postgres Evolutions:
1214
- [134-dataset-layer-attachments.sql](conf/evolutions/134-dataset-layer-attachments.sql)

conf/application.conf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,12 @@ play {
6666
pekko.actor.default-dispatcher {
6767
# We use a compromise for our thread pool configuration
6868
# Parts of our api are async, so they should not need many threads,
69-
# but some parts are also blocking (file io, gcs, s3 access), causing new requests
69+
# but some parts are also blocking (some file io, gcs access), causing new requests
7070
# to wait despite idle cpu, if there are too few threads
7171
fork-join-executor {
72-
parallelism-factor = 5.0 # Thread count = ceil(available processors * factor)
72+
parallelism-factor = 10.0 # Thread count = ceil(available processors * factor)
7373
parallelism-min = 8 # Min number of threads to cap factor-based parallelism number to
74-
parallelism-max = 300 # Max number of threads to cap factor-based parallelism number to
74+
parallelism-max = 1000 # Max number of threads to cap factor-based parallelism number to
7575
}
7676
}
7777

frontend/javascripts/admin/rest_api.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import dayjs from "dayjs";
22
import { V3 } from "libs/mjs";
3-
import type { RequestOptions } from "libs/request";
3+
import type { RequestOptions, RequestOptionsWithData } from "libs/request";
44
import Request from "libs/request";
55
import type { Message } from "libs/toast";
66
import Toast from "libs/toast";
@@ -90,6 +90,7 @@ import type {
9090
MappingType,
9191
NumberLike,
9292
PartialDatasetConfiguration,
93+
SaveQueueEntry,
9394
StoreAnnotation,
9495
TraceOrViewCommand,
9596
UserConfiguration,
@@ -2398,3 +2399,12 @@ export function requestVerificationMail() {
23982399
method: "POST",
23992400
});
24002401
}
2402+
2403+
export function sendSaveRequestWithToken(
2404+
urlWithoutToken: string,
2405+
data: RequestOptionsWithData<Array<SaveQueueEntry>>,
2406+
): Promise<void> {
2407+
// Ideally, this function should be refactored further so that it generates the
2408+
// correct urlWithoutToken itself.
2409+
return doWithToken((token) => Request.sendJSONReceiveJSON(`${urlWithoutToken}${token}`, data));
2410+
}

frontend/javascripts/libs/utils.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1303,3 +1303,11 @@ export function getPhraseFromCamelCaseString(stringInCamelCase: string): string
13031303
.map((word) => capitalize(word.replace(/(^|\s)td/, "$13D")))
13041304
.join(" ");
13051305
}
1306+
1307+
export function areSetsEqual<T>(setA: Set<T>, setB: Set<T>) {
1308+
if (setA.size !== setB.size) return false;
1309+
for (const val of setA) {
1310+
if (!setB.has(val)) return false;
1311+
}
1312+
return true;
1313+
}

frontend/javascripts/test/api/api_skeleton_latest.spec.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,9 @@ import { vi, describe, it, expect, beforeEach } from "vitest";
88
import type { Vector3 } from "viewer/constants";
99
import { enforceSkeletonTracing } from "viewer/model/accessors/skeletontracing_accessor";
1010

11-
// All the mocking is done in the helpers file, so it can be reused for both skeleton and volume API
1211
describe("API Skeleton", () => {
1312
beforeEach<WebknossosTestContext>(async (context) => {
14-
await setupWebknossosForTesting(context, "skeleton");
13+
await setupWebknossosForTesting(context, "skeleton", { dontDispatchWkReady: true });
1514
});
1615

1716
it<WebknossosTestContext>("getActiveNodeId should get the active node id", ({ api }) => {

frontend/javascripts/test/api/api_volume_latest.spec.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import {
77
} from "../fixtures/volumetracing_server_objects";
88
import { AnnotationTool } from "viewer/model/accessors/tool_accessor";
99

10-
// All the mocking is done in the helpers file, so it can be reused for both skeleton and volume API
1110
describe("API Volume", () => {
1211
beforeEach<WebknossosTestContext>(async (context) => {
1312
await setupWebknossosForTesting(context, "volume");

frontend/javascripts/test/backend-snapshot-tests/annotations.e2e.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { createTreeMapFromTreeArray } from "viewer/model/reducers/skeletontracin
1111
import { diffTrees } from "viewer/model/sagas/skeletontracing_saga";
1212
import { getNullableSkeletonTracing } from "viewer/model/accessors/skeletontracing_accessor";
1313
import { getServerVolumeTracings } from "viewer/model/accessors/volumetracing_accessor";
14-
import { sendRequestWithToken, addVersionNumbers } from "viewer/model/sagas/save_saga";
14+
import { addVersionNumbers } from "viewer/model/sagas/save_saga";
1515
import * as UpdateActions from "viewer/model/sagas/update_actions";
1616
import * as api from "admin/rest_api";
1717
import generateDummyTrees from "viewer/model/helpers/generate_dummy_trees";
@@ -174,7 +174,7 @@ describe("Annotation API (E2E)", () => {
174174
});
175175

176176
async function sendUpdateActions(explorational: APIAnnotation, queue: SaveQueueEntry[]) {
177-
return sendRequestWithToken(
177+
return api.sendSaveRequestWithToken(
178178
`${explorational.tracingStore.url}/tracings/annotation/${explorational.id}/update?token=`,
179179
{
180180
method: "POST",

frontend/javascripts/test/fixtures/skeletontracing_server_objects.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ import {
55
type APITracingStoreAnnotation,
66
} from "types/api_types";
77

8-
const TRACING_ID = "47e37793-d0be-4240-a371-87ce68561a13";
8+
const TRACING_ID = "skeletonTracingId-47e37793-d0be-4240-a371-87ce68561a13";
99

1010
export const tracing: ServerSkeletonTracing = {
1111
typ: AnnotationLayerEnum.Skeleton,
12-
id: "47e37793-d0be-4240-a371-87ce68561a13",
12+
id: TRACING_ID,
1313
trees: [
1414
{
1515
treeId: 2,

frontend/javascripts/test/fixtures/tasktracing_server_objects.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
type APITracingStoreAnnotation,
66
} from "types/api_types";
77

8-
const TRACING_ID = "e90133de-b2db-4912-8261-8b6f84f7edab";
8+
const TRACING_ID = "skeletonTracingId-e90133de-b2db-4912-8261-8b6f84f7edab";
99
export const tracing: ServerSkeletonTracing = {
1010
typ: "Skeleton",
1111
trees: [
@@ -42,7 +42,7 @@ export const tracing: ServerSkeletonTracing = {
4242
b: 0,
4343
a: 1,
4444
},
45-
name: "",
45+
name: "", // there is a test that asserts that empty names will be renamed automatically
4646
isVisible: true,
4747
createdTimestamp: 1528811979356,
4848
metadata: [],
@@ -65,27 +65,27 @@ export const tracing: ServerSkeletonTracing = {
6565
},
6666
additionalAxes: [],
6767
zoomLevel: 2,
68-
id: "e90133de-b2db-4912-8261-8b6f84f7edab",
68+
id: TRACING_ID,
6969
};
7070
export const annotation: APIAnnotation = {
71-
datasetId: "66f3c82966010034942e9740",
71+
datasetId: "datasetId-66f3c82966010034942e9740",
7272
modified: 1529066010230,
7373
state: "Active",
74-
id: "5b1fd1cf97000027049c67ee",
74+
id: "annotationId-5b1fd1cf97000027049c67ee",
7575
name: "",
7676
description: "",
7777
stats: {},
7878
typ: "Task",
7979
task: {
80-
id: "5b1fd1cb97000027049c67ec",
80+
id: "taskId-5b1fd1cb97000027049c67ec",
8181
projectName: "sampleProject",
8282
projectId: "dummy-project-id",
8383
team: "Connectomics department",
8484
type: {
8585
id: "5b1e45faa000009d00abc2c6",
8686
summary: "sampleTaskType",
8787
description: "Description",
88-
teamId: "5b1e45f9a00000a000abc2c3",
88+
teamId: "teamId-5b1e45f9a00000a000abc2c3",
8989
teamName: "Connectomics department",
9090
settings: {
9191
allowedModes: ["orthogonal", "oblique", "flight"],
@@ -98,7 +98,7 @@ export const annotation: APIAnnotation = {
9898
recommendedConfiguration: null,
9999
tracingType: "skeleton",
100100
},
101-
datasetId: "66f3c82966010034942e9740",
101+
datasetId: "datasetId-66f3c82966010034942e9740",
102102
datasetName: "ROI2017_wkw",
103103
neededExperience: {
104104
domain: "oxalis",
@@ -156,7 +156,7 @@ export const annotation: APIAnnotation = {
156156
tracingTime: null,
157157
tags: ["ROI2017_wkw", "skeleton"],
158158
owner: {
159-
id: "5b1e45faa00000a900abc2c5",
159+
id: "userId-5b1e45faa00000a900abc2c5",
160160
email: "sample@scm.io",
161161
firstName: "Sample",
162162
lastName: "User",
@@ -165,7 +165,7 @@ export const annotation: APIAnnotation = {
165165
isDatasetManager: true,
166166
teams: [
167167
{
168-
id: "5b1e45f9a00000a000abc2c3",
168+
id: "teamId-5b1e45f9a00000a000abc2c3",
169169
name: "Connectomics department",
170170
isTeamManager: true,
171171
},
@@ -176,7 +176,7 @@ export const annotation: APIAnnotation = {
176176
isLockedByOwner: false,
177177
teams: [
178178
{
179-
id: "5b1e45f9a00000a000abc2c3",
179+
id: "teamId-5b1e45f9a00000a000abc2c3",
180180
name: "Connectomics department",
181181
organization: "Connectomics department",
182182
},

0 commit comments

Comments
 (0)