Closed cessda-bitbucket-importer closed 2 years ago
Original comment by Taina Jääskeläinen.
The Exercise CV is no longer in staging. You can use Testing CV 2 for testing moving codes to wanted order and adding new codes. I have put numbers on the codes.
In short, the system should work like this:
I do not know why sometimes an added code does not appear in the export. Please check that this is not due to the export table not being cleared when the user navigates to some other tab, or that the export table is not updated when the user opens the tab.
I do not know why refreshing the page sometimes makes an added code disappear.
For you to test the problem: try to add code6, a child to it, and code7. Move code 8 to its rightful position as the last term. Try to get all codes in the right order, using the Add code and Move code buttons, and check at the end that the exports are correct.
Original comment by Taina Jääskeläinen.
Note that this is a blocker/critical issue.
Original comment by Stefan Dlugolinsky (GitHub: Stifo).
Taina, many thanks for the details. I’m testing it right now according to your guidelines.
Original comment by Stefan Dlugolinsky (GitHub: Stifo).
I’ll make my notes from the testing here:
tried to create a new code “code11”
different code instances in the list have the same code value (two “code6” instances) and ?concept.position? (“Code3” and “Code8” share “4“, two “code6.child1” share “11“ and two “code6.child2” share “9“)
the system allowed to create two codes with the same code value “code6”, while it should not allow that as the code value must be unique (right?)
code actions Add, Move are not immediately visible, but the Delete action is
refresh in browser (e.g., F5, cmd+R) and vocabulary editor page reopen hide/unhide the Add action at random
when a code is selected and highlighted, it cannot be unselected so that there’s no code in the list selected (an empty selection is not possible)
noticed two red errors in the Move popup form after clicking on “Save”
errors:
the issue is probably caused by a sync conflict, when two different users modifies the same data (need to investigate further)
could not reproduce the same problems within a local deployment of the master (commit de2f37e598a47b095f2c3044ed7caae58d2d3887) - db problem?
inspecting, whether it is a DB problem (artificially introducing bad data into the DB):
2 different code instances with the same code value (cvs.concept.notation)
2 different code instances with the same code value (cvs.concept.notation) and the same position (cvs.concept.position)
all the changes to codes are immediatelly visible in local instance of the app, while at staging not.
Original comment by Taina Jääskeläinen.
Stefan, your results are the same as mine. I added a new code in staging and saved. If I remember correctly, the new code does not necessarily reappear in the table, even when clicking on refresh. When I added another new code, then the new code previously entered suddenly appears in the table but not necessarily in the correct position.
And even more erratic behaviour in downloads.
Original comment by Stefan Dlugolinsky (GitHub: Stifo).
Codes out of order issue:
the position of the newly created concept is calculated in editor-detail-code-add-edit-dialog.component.ts, which is happening at the client side after clicking the “Save” button of the “Add code“ dialog.
the position is calculated as a) the length of the actual list of concepts; i.e., the next free position in the list (this.versionParam.concepts!.length); b) relatively (±1) to the selected concept.
Q: When is the actual list of concepts retrieved by the client?
localy tested (two different users, each in a separate browser): userA and userB open editor of the same CV. userA creates a new code at 01:36 and saves it. the code “userA“ is seen in the list of codes by userA. userB creates a new code at 01:38 and saves it. userB sees both codes “userA” and “userB”, but his code is in the list before codeA:
* test in staging (one user, two login sessions in two different browsers): opened the same CV editor in browserA and browserB. in browserA, created new code at 01:52 and saved. the new code was seen in the list. in browserB, created a new code at 01:53 and saved. instead of the both new codes, only the code created in the browserA was displayed in the list.
refreshing browserB multiple times didn’t show code created in browserB:
* refresing browserA second time showed both codes in chronological order having the same position “20”:
test in staging (one user, one login session): created a new CV and populated with several codes. noticed, that two codes have identical position; i.e., code3 and code4 have position attribute “3”. they are ordered chronologically (code3, code4).
possible solutions:
Original comment by Stefan Dlugolinsky (GitHub: Stifo).
Tests1
created new CV
created a new code and hit the “Save” button
XHR to create the new code:
curl 'https://vocabularies-staging.cessda.eu/api/editors/codes' \ -H 'authority: vocabularies-staging.cessda.eu' \ -H 'sec-ch-ua: " Not;A Brand";v="99", "Google Chrome";v="97", "Chromium";v="97"' \ -H 'accept: application/json, text/plain, */*' \ -H 'content-type: application/json' \ -H 'authorization: Bearer ********' \ -H 'sec-ch-ua-mobile: ?0' \ -H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.99 Safari/537.36' \ -H 'sec-ch-ua-platform: "macOS"' \ -H 'origin: https://vocabularies-staging.cessda.eu' \ -H 'sec-fetch-site: same-origin' \ -H 'sec-fetch-mode: cors' \ -H 'sec-fetch-dest: empty' \ -H 'referer: https://vocabularies-staging.cessda.eu/editor/vocabulary/test_cv3' \ -H 'accept-language: en-US,en;q=0.9' \ -H 'cookie: ********' \ --data-raw '{"actionType":"CREATE_CODE","versionId":582,"notation":"c1","title":"c1","definition":"c1","position":0,"insertionRefConceptId":null,"relPosToRefConcept":1,"changeType":"Code added","changeDesc":"c1"}' \ --compressed
payload:
{ "actionType": "CREATE_CODE", "versionId": 582, "notation": "c1", "title": "c1", "definition": "c1", "position": 0, "insertionRefConceptId": null, "relPosToRefConcept": 1, "changeType": "Code added", "changeDesc": "c1" }
response:
{"id":14631,"notation":"c1","title":"c1","definition":"c1","versionId":582,"position":0}
the new code didn’t appear in the list of refreshed CV codes. the XHR request returned a list of codes, where the new code was missing. clearing browser cache didn’t help. cache at the server side?
XHR request to get the latest state of the CV after saving the code “c1”:
curl 'https://vocabularies-staging.cessda.eu/api/vocabularies/test_cv3/latest' \ -H 'authority: vocabularies-staging.cessda.eu' \ -H 'sec-ch-ua: " Not;A Brand";v="99", "Google Chrome";v="97", "Chromium";v="97"' \ -H 'accept: application/json, text/plain, */*' \ -H 'authorization: Bearer ********' \ -H 'sec-ch-ua-mobile: ?0' \ -H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.99 Safari/537.36' \ -H 'sec-ch-ua-platform: "macOS"' \ -H 'sec-fetch-site: same-origin' \ -H 'sec-fetch-mode: cors' \ -H 'sec-fetch-dest: empty' \ -H 'referer: https://vocabularies-staging.cessda.eu/editor/vocabulary/test_cv3' \ -H 'accept-language: en-US,en;q=0.9' \ -H 'cookie: ********' \ --compressed
response:
{ "id": 91, "status": "DRAFT", "notation": "test_cv3", "versionNumber": "1.0", "archived": false, "withdrawn": false, "discoverable": true, "sourceLanguage": "en", "agencyId": 1, "agencyName": "CESSDA", "agencyLogo": "cessda.png", "agencyLink": "https://www.cessda.eu/", "codes": [], "versions": [ { "id": 582, "status": "DRAFT", "itemType": "SL", "language": "en", "creationDate": "2022-02-03", "number": "1.0", "title": "test_cv3", "definition": "test_cv3", "notation": "test_cv3", "creator": 107, "vocabularyId": 91, "concepts": [], "comments": [], "versionHistories": [] } ], "versionEn": "1.0", "titleEn": "test_cv3", "definitionEn": "test_cv3" }
→ i suspect caching of concepts
Original comment by Taina Jääskeläinen.
If you can find a way to simplify giving order to the codes, that would be very good.
Currently the system works so that the user enters into code value the code (e.g. child 2) and then when they choose to ‘insert as child’, the system adds the hierarchy to the code (code6.child2). If it makes things easier and is not difficult to code, the system can be changed so that instead:
But not being technical, not sure if this would of any help to remove the current difficulties.
Original comment by Stefan Dlugolinsky (GitHub: Stifo).
I’m still trying to figure out the cause of the problem. This issue is a tough one. My latest findings are that it is caused by caching, because after I save the new code, the system returns old list without the new code in it, while the new code is saved in the DB, because after some time, it appears in the list.
Besides that, I found a problem that the position of the new code is computed at the client side, which may lead to having two different codes with the same position in the list. It happens when someone else is editing the same CV simultaneously. This led also to unexpected code order. This is fixed - the position of the new code is now computed at the server side. Instead of the absolute position, the client sends along with the new code the ID of the selected code in the list and relative placement (0 - before, 1 - after). If no code is selected, the new code is put at the end of the list. However, there are cases when this fix do not work and all my tests lead to caching.
Regarding your suggestion on changing the way users create code hierarchies, I suggest to create a new feature request for it. I would be happy to implement it, but first of all, I would like to fix this #349 issue with minimum changes to the original code and logic, because otherwise more errors could be induced.
Original comment by Taina Jääskeläinen.
If you can fix the the original code and keep the logic, that would be the optimal solution.
I only suggested changing it as an (unwanted) alternative in case you cannot fix the original code. We have no problems with how the system creates hierarchy. If it works, it is quite logical and easy to use for the user.
Original comment by Taina Jääskeläinen.
I had to make a new vocbulary draft in the production version today. No problems with creating hierarchy there. The CV only has four terms, of which two are narrower terms, so may not be conclusive information.
Still, is this of any help in figuring out the problem?
Original comment by Taina Jääskeläinen.
I created a new vocabulary in staging since I needed a download of the draft for group discussion.
The phenomena commented by Stefan occurred: a new code is added but sometimes the system returns the old list without the new code but the new code appears in the list after a while. This occurred for one code only (the second one) even though I entered four ones altogether.
Moved two codes (one as a child, another as sibling), the system performed these correctly.
Original comment by Stefan Dlugolinsky (GitHub: Stifo).
I still suspect caching, but I still didn’t localize it though. There might be different settings for production, staging and dev when deploying the app. When testing the issue locally, there’s never a problem.
I did another tests today, to check, whether it is at the client side. I’ve replicated the original XHR request by which the client reads the latest CV data from the server and executed it 10 times in a loop:
for i in `seq 10`; { curl 'https://vocabularies-staging.cessda.eu/api/vocabularies/test_cv3/latest' \
-H 'authority: vocabularies-staging.cessda.eu' \
-H 'sec-ch-ua: " Not;A Brand";v="99", "Google Chrome";v="97", "Chromium";v="97"' \
-H 'accept: application/json, text/plain, */*' \
-H 'authorization: Bearer ********' \
-H 'sec-ch-ua-mobile: ?0' \
-H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.99 Safari/537.36' \
-H 'sec-ch-ua-platform: "macOS"' \
-H 'sec-fetch-site: same-origin' \
-H 'sec-fetch-mode: cors' \
-H 'sec-fetch-dest: empty' \
-H 'referer: https://vocabularies-staging.cessda.eu/editor/vocabulary/test_cv3?tab=export' \
-H 'accept-language: en-US,en;q=0.9' \
-H 'cookie: ********' \
--compressed | json_pp; } > latest.log
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 349 0 349 0 0 1753 0 --:--:-- --:--:-- --:--:-- 1753
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 349 0 349 0 0 1638 0 --:--:-- --:--:-- --:--:-- 1638
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 349 0 349 0 0 1558 0 --:--:-- --:--:-- --:--:-- 1558
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 349 0 349 0 0 1798 0 --:--:-- --:--:-- --:--:-- 1789
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 349 0 349 0 0 1817 0 --:--:-- --:--:-- --:--:-- 1817
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 397 0 397 0 0 1936 0 --:--:-- --:--:-- --:--:-- 1946
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 349 0 349 0 0 1551 0 --:--:-- --:--:-- --:--:-- 1551
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 397 0 397 0 0 1872 0 --:--:-- --:--:-- --:--:-- 1863
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 349 0 349 0 0 1593 0 --:--:-- --:--:-- --:--:-- 1593
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 397 0 397 0 0 1946 0 --:--:-- --:--:-- --:--:-- 1946
The results were weird, concepts appeared and disappeared at random. At the time of calling the XHR request, there were 4 concepts in the CV (c1, c2, c3, and c4):
{
"agencyId" : 1,
"agencyLink" : "https://www.cessda.eu/",
"agencyLogo" : "cessda.png",
"agencyName" : "CESSDA",
"archived" : false,
"codes" : [],
"definitionEn" : "test_cv3",
"discoverable" : true,
"id" : 91,
"notation" : "test_cv3",
"sourceLanguage" : "en",
"status" : "DRAFT",
"titleEn" : "test_cv3",
"versionEn" : "1.0",
"versionNumber" : "1.0",
"versions" : [
{
"comments" : [],
"concepts" : [
{
"definition" : "c1",
"id" : 14631,
"notation" : "c1",
"position" : 0,
"title" : "c1",
"versionId" : 582
}
],
"creationDate" : "2022-02-03",
"creator" : 107,
"definition" : "test_cv3",
"id" : 582,
"itemType" : "SL",
"language" : "en",
"notation" : "test_cv3",
"number" : "1.0",
"status" : "DRAFT",
"title" : "test_cv3",
"versionHistories" : [],
"vocabularyId" : 91
}
],
"withdrawn" : false
}
{
"agencyId" : 1,
"agencyLink" : "https://www.cessda.eu/",
"agencyLogo" : "cessda.png",
"agencyName" : "CESSDA",
"archived" : false,
"codes" : [],
"definitionEn" : "test_cv3",
"discoverable" : true,
"id" : 91,
"notation" : "test_cv3",
"sourceLanguage" : "en",
"status" : "DRAFT",
"titleEn" : "test_cv3",
"versionEn" : "1.0",
"versionNumber" : "1.0",
"versions" : [
{
"comments" : [],
"concepts" : [
{
"definition" : "c1",
"id" : 14631,
"notation" : "c1",
"position" : 0,
"title" : "c1",
"versionId" : 582
}
],
"creationDate" : "2022-02-03",
"creator" : 107,
"definition" : "test_cv3",
"id" : 582,
"itemType" : "SL",
"language" : "en",
"notation" : "test_cv3",
"number" : "1.0",
"status" : "DRAFT",
"title" : "test_cv3",
"versionHistories" : [],
"vocabularyId" : 91
}
],
"withdrawn" : false
}
{
"agencyId" : 1,
"agencyLink" : "https://www.cessda.eu/",
"agencyLogo" : "cessda.png",
"agencyName" : "CESSDA",
"archived" : false,
"codes" : [],
"definitionEn" : "test_cv3",
"discoverable" : true,
"id" : 91,
"notation" : "test_cv3",
"sourceLanguage" : "en",
"status" : "DRAFT",
"titleEn" : "test_cv3",
"versionEn" : "1.0",
"versionNumber" : "1.0",
"versions" : [
{
"comments" : [],
"concepts" : [
{
"definition" : "c1",
"id" : 14631,
"notation" : "c1",
"position" : 0,
"title" : "c1",
"versionId" : 582
}
],
"creationDate" : "2022-02-03",
"creator" : 107,
"definition" : "test_cv3",
"id" : 582,
"itemType" : "SL",
"language" : "en",
"notation" : "test_cv3",
"number" : "1.0",
"status" : "DRAFT",
"title" : "test_cv3",
"versionHistories" : [],
"vocabularyId" : 91
}
],
"withdrawn" : false
}
{
"agencyId" : 1,
"agencyLink" : "https://www.cessda.eu/",
"agencyLogo" : "cessda.png",
"agencyName" : "CESSDA",
"archived" : false,
"codes" : [],
"definitionEn" : "test_cv3",
"discoverable" : true,
"id" : 91,
"notation" : "test_cv3",
"sourceLanguage" : "en",
"status" : "DRAFT",
"titleEn" : "test_cv3",
"versionEn" : "1.0",
"versionNumber" : "1.0",
"versions" : [
{
"comments" : [],
"concepts" : [
{
"definition" : "c1",
"id" : 14631,
"notation" : "c1",
"position" : 0,
"title" : "c1",
"versionId" : 582
}
],
"creationDate" : "2022-02-03",
"creator" : 107,
"definition" : "test_cv3",
"id" : 582,
"itemType" : "SL",
"language" : "en",
"notation" : "test_cv3",
"number" : "1.0",
"status" : "DRAFT",
"title" : "test_cv3",
"versionHistories" : [],
"vocabularyId" : 91
}
],
"withdrawn" : false
}
{
"agencyId" : 1,
"agencyLink" : "https://www.cessda.eu/",
"agencyLogo" : "cessda.png",
"agencyName" : "CESSDA",
"archived" : false,
"codes" : [],
"definitionEn" : "test_cv3",
"discoverable" : true,
"id" : 91,
"notation" : "test_cv3",
"sourceLanguage" : "en",
"status" : "DRAFT",
"titleEn" : "test_cv3",
"versionEn" : "1.0",
"versionNumber" : "1.0",
"versions" : [
{
"comments" : [],
"concepts" : [
{
"definition" : "c1",
"id" : 14631,
"notation" : "c1",
"position" : 0,
"title" : "c1",
"versionId" : 582
}
],
"creationDate" : "2022-02-03",
"creator" : 107,
"definition" : "test_cv3",
"id" : 582,
"itemType" : "SL",
"language" : "en",
"notation" : "test_cv3",
"number" : "1.0",
"status" : "DRAFT",
"title" : "test_cv3",
"versionHistories" : [],
"vocabularyId" : 91
}
],
"withdrawn" : false
}
{
"agencyId" : 1,
"agencyLink" : "https://www.cessda.eu/",
"agencyLogo" : "cessda.png",
"agencyName" : "CESSDA",
"archived" : false,
"codes" : [],
"definitionEn" : "test_cv3",
"discoverable" : true,
"id" : 91,
"notation" : "test_cv3",
"sourceLanguage" : "en",
"status" : "DRAFT",
"titleEn" : "test_cv3",
"versionEn" : "1.0",
"versionNumber" : "1.0",
"versions" : [
{
"comments" : [],
"concepts" : [
{
"definition" : "c1",
"id" : 14631,
"notation" : "c1",
"position" : 0,
"title" : "c1",
"versionId" : 582
},
{
"definition" : "d2",
"id" : 14636,
"notation" : "c2",
"position" : 1,
"title" : "t2",
"versionId" : 582
},
{
"definition" : "d3",
"id" : 14637,
"notation" : "c3",
"position" : 2,
"title" : "t3",
"versionId" : 582
},
{
"definition" : "d4",
"id" : 14638,
"notation" : "c4",
"position" : 3,
"title" : "t4",
"versionId" : 582
}
],
"creationDate" : "2022-02-03",
"creator" : 107,
"definition" : "test_cv3",
"id" : 582,
"itemType" : "SL",
"language" : "en",
"notation" : "test_cv3",
"number" : "1.0",
"status" : "DRAFT",
"title" : "test_cv3",
"versionHistories" : [],
"vocabularyId" : 91
}
],
"withdrawn" : false
}
{
"agencyId" : 1,
"agencyLink" : "https://www.cessda.eu/",
"agencyLogo" : "cessda.png",
"agencyName" : "CESSDA",
"archived" : false,
"codes" : [],
"definitionEn" : "test_cv3",
"discoverable" : true,
"id" : 91,
"notation" : "test_cv3",
"sourceLanguage" : "en",
"status" : "DRAFT",
"titleEn" : "test_cv3",
"versionEn" : "1.0",
"versionNumber" : "1.0",
"versions" : [
{
"comments" : [],
"concepts" : [
{
"definition" : "c1",
"id" : 14631,
"notation" : "c1",
"position" : 0,
"title" : "c1",
"versionId" : 582
}
],
"creationDate" : "2022-02-03",
"creator" : 107,
"definition" : "test_cv3",
"id" : 582,
"itemType" : "SL",
"language" : "en",
"notation" : "test_cv3",
"number" : "1.0",
"status" : "DRAFT",
"title" : "test_cv3",
"versionHistories" : [],
"vocabularyId" : 91
}
],
"withdrawn" : false
}
{
"agencyId" : 1,
"agencyLink" : "https://www.cessda.eu/",
"agencyLogo" : "cessda.png",
"agencyName" : "CESSDA",
"archived" : false,
"codes" : [],
"definitionEn" : "test_cv3",
"discoverable" : true,
"id" : 91,
"notation" : "test_cv3",
"sourceLanguage" : "en",
"status" : "DRAFT",
"titleEn" : "test_cv3",
"versionEn" : "1.0",
"versionNumber" : "1.0",
"versions" : [
{
"comments" : [],
"concepts" : [
{
"definition" : "c1",
"id" : 14631,
"notation" : "c1",
"position" : 0,
"title" : "c1",
"versionId" : 582
},
{
"definition" : "d2",
"id" : 14636,
"notation" : "c2",
"position" : 1,
"title" : "t2",
"versionId" : 582
},
{
"definition" : "d3",
"id" : 14637,
"notation" : "c3",
"position" : 2,
"title" : "t3",
"versionId" : 582
},
{
"definition" : "d4",
"id" : 14638,
"notation" : "c4",
"position" : 3,
"title" : "t4",
"versionId" : 582
}
],
"creationDate" : "2022-02-03",
"creator" : 107,
"definition" : "test_cv3",
"id" : 582,
"itemType" : "SL",
"language" : "en",
"notation" : "test_cv3",
"number" : "1.0",
"status" : "DRAFT",
"title" : "test_cv3",
"versionHistories" : [],
"vocabularyId" : 91
}
],
"withdrawn" : false
}
{
"agencyId" : 1,
"agencyLink" : "https://www.cessda.eu/",
"agencyLogo" : "cessda.png",
"agencyName" : "CESSDA",
"archived" : false,
"codes" : [],
"definitionEn" : "test_cv3",
"discoverable" : true,
"id" : 91,
"notation" : "test_cv3",
"sourceLanguage" : "en",
"status" : "DRAFT",
"titleEn" : "test_cv3",
"versionEn" : "1.0",
"versionNumber" : "1.0",
"versions" : [
{
"comments" : [],
"concepts" : [
{
"definition" : "c1",
"id" : 14631,
"notation" : "c1",
"position" : 0,
"title" : "c1",
"versionId" : 582
}
],
"creationDate" : "2022-02-03",
"creator" : 107,
"definition" : "test_cv3",
"id" : 582,
"itemType" : "SL",
"language" : "en",
"notation" : "test_cv3",
"number" : "1.0",
"status" : "DRAFT",
"title" : "test_cv3",
"versionHistories" : [],
"vocabularyId" : 91
}
],
"withdrawn" : false
}
{
"agencyId" : 1,
"agencyLink" : "https://www.cessda.eu/",
"agencyLogo" : "cessda.png",
"agencyName" : "CESSDA",
"archived" : false,
"codes" : [],
"definitionEn" : "test_cv3",
"discoverable" : true,
"id" : 91,
"notation" : "test_cv3",
"sourceLanguage" : "en",
"status" : "DRAFT",
"titleEn" : "test_cv3",
"versionEn" : "1.0",
"versionNumber" : "1.0",
"versions" : [
{
"comments" : [],
"concepts" : [
{
"definition" : "c1",
"id" : 14631,
"notation" : "c1",
"position" : 0,
"title" : "c1",
"versionId" : 582
},
{
"definition" : "d2",
"id" : 14636,
"notation" : "c2",
"position" : 1,
"title" : "t2",
"versionId" : 582
},
{
"definition" : "d3",
"id" : 14637,
"notation" : "c3",
"position" : 2,
"title" : "t3",
"versionId" : 582
},
{
"definition" : "d4",
"id" : 14638,
"notation" : "c4",
"position" : 3,
"title" : "t4",
"versionId" : 582
}
],
"creationDate" : "2022-02-03",
"creator" : 107,
"definition" : "test_cv3",
"id" : 582,
"itemType" : "SL",
"language" : "en",
"notation" : "test_cv3",
"number" : "1.0",
"status" : "DRAFT",
"title" : "test_cv3",
"versionHistories" : [],
"vocabularyId" : 91
}
],
"withdrawn" : false
}
Then I repeated the same test, but I added following headers to the XHR request in order to disable caching both at the client (pragma: no-cache) and server side (cache-control: no-cache):
-H 'pragma: no-cache' \
-H 'cache-control: no-cache' \
Requests:
for i in `seq 10`; { curl 'https://vocabularies-staging.cessda.eu/api/vocabularies/test_cv3/latest' \
-H 'authority: vocabularies-staging.cessda.eu' \
-H 'pragma: no-cache' \
-H 'cache-control: no-cache' \
-H 'sec-ch-ua: " Not;A Brand";v="99", "Google Chrome";v="97", "Chromium";v="97"' \
-H 'accept: application/json, text/plain, */*' \
-H 'authorization: Bearer ********' \
-H 'sec-ch-ua-mobile: ?0' \
-H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.99 Safari/537.36' \
-H 'sec-ch-ua-platform: "macOS"' \
-H 'sec-fetch-site: same-origin' \
-H 'sec-fetch-mode: cors' \
-H 'sec-fetch-dest: empty' \
-H 'referer: https://vocabularies-staging.cessda.eu/editor/vocabulary/test_cv3' \
-H 'accept-language: en-US,en;q=0.9' \
-H 'cookie: ********' \
--compressed | json_pp } > latest-no-cache.log
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 397 0 397 0 0 1863 0 --:--:-- --:--:-- --:--:-- 1863
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 397 0 397 0 0 1772 0 --:--:-- --:--:-- --:--:-- 1772
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 397 0 397 0 0 1890 0 --:--:-- --:--:-- --:--:-- 1890
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 397 0 397 0 0 1975 0 --:--:-- --:--:-- --:--:-- 1965
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 349 0 349 0 0 1702 0 --:--:-- --:--:-- --:--:-- 1702
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 349 0 349 0 0 1669 0 --:--:-- --:--:-- --:--:-- 1669
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 349 0 349 0 0 1638 0 --:--:-- --:--:-- --:--:-- 1638
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 349 0 349 0 0 1745 0 --:--:-- --:--:-- --:--:-- 1736
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 397 0 397 0 0 1965 0 --:--:-- --:--:-- --:--:-- 1965
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 397 0 397 0 0 1872 0 --:--:-- --:--:-- --:--:-- 1872
Results:
{
"agencyId" : 1,
"agencyLink" : "https://www.cessda.eu/",
"agencyLogo" : "cessda.png",
"agencyName" : "CESSDA",
"archived" : false,
"codes" : [],
"definitionEn" : "test_cv3",
"discoverable" : true,
"id" : 91,
"notation" : "test_cv3",
"sourceLanguage" : "en",
"status" : "DRAFT",
"titleEn" : "test_cv3",
"versionEn" : "1.0",
"versionNumber" : "1.0",
"versions" : [
{
"comments" : [],
"concepts" : [
{
"definition" : "c1",
"id" : 14631,
"notation" : "c1",
"position" : 0,
"title" : "c1",
"versionId" : 582
},
{
"definition" : "d2",
"id" : 14636,
"notation" : "c2",
"position" : 1,
"title" : "t2",
"versionId" : 582
},
{
"definition" : "d3",
"id" : 14637,
"notation" : "c3",
"position" : 2,
"title" : "t3",
"versionId" : 582
},
{
"definition" : "d4",
"id" : 14638,
"notation" : "c4",
"position" : 3,
"title" : "t4",
"versionId" : 582
}
],
"creationDate" : "2022-02-03",
"creator" : 107,
"definition" : "test_cv3",
"id" : 582,
"itemType" : "SL",
"language" : "en",
"notation" : "test_cv3",
"number" : "1.0",
"status" : "DRAFT",
"title" : "test_cv3",
"versionHistories" : [],
"vocabularyId" : 91
}
],
"withdrawn" : false
}
{
"agencyId" : 1,
"agencyLink" : "https://www.cessda.eu/",
"agencyLogo" : "cessda.png",
"agencyName" : "CESSDA",
"archived" : false,
"codes" : [],
"definitionEn" : "test_cv3",
"discoverable" : true,
"id" : 91,
"notation" : "test_cv3",
"sourceLanguage" : "en",
"status" : "DRAFT",
"titleEn" : "test_cv3",
"versionEn" : "1.0",
"versionNumber" : "1.0",
"versions" : [
{
"comments" : [],
"concepts" : [
{
"definition" : "c1",
"id" : 14631,
"notation" : "c1",
"position" : 0,
"title" : "c1",
"versionId" : 582
},
{
"definition" : "d2",
"id" : 14636,
"notation" : "c2",
"position" : 1,
"title" : "t2",
"versionId" : 582
},
{
"definition" : "d3",
"id" : 14637,
"notation" : "c3",
"position" : 2,
"title" : "t3",
"versionId" : 582
},
{
"definition" : "d4",
"id" : 14638,
"notation" : "c4",
"position" : 3,
"title" : "t4",
"versionId" : 582
}
],
"creationDate" : "2022-02-03",
"creator" : 107,
"definition" : "test_cv3",
"id" : 582,
"itemType" : "SL",
"language" : "en",
"notation" : "test_cv3",
"number" : "1.0",
"status" : "DRAFT",
"title" : "test_cv3",
"versionHistories" : [],
"vocabularyId" : 91
}
],
"withdrawn" : false
}
{
"agencyId" : 1,
"agencyLink" : "https://www.cessda.eu/",
"agencyLogo" : "cessda.png",
"agencyName" : "CESSDA",
"archived" : false,
"codes" : [],
"definitionEn" : "test_cv3",
"discoverable" : true,
"id" : 91,
"notation" : "test_cv3",
"sourceLanguage" : "en",
"status" : "DRAFT",
"titleEn" : "test_cv3",
"versionEn" : "1.0",
"versionNumber" : "1.0",
"versions" : [
{
"comments" : [],
"concepts" : [
{
"definition" : "c1",
"id" : 14631,
"notation" : "c1",
"position" : 0,
"title" : "c1",
"versionId" : 582
},
{
"definition" : "d2",
"id" : 14636,
"notation" : "c2",
"position" : 1,
"title" : "t2",
"versionId" : 582
},
{
"definition" : "d3",
"id" : 14637,
"notation" : "c3",
"position" : 2,
"title" : "t3",
"versionId" : 582
},
{
"definition" : "d4",
"id" : 14638,
"notation" : "c4",
"position" : 3,
"title" : "t4",
"versionId" : 582
}
],
"creationDate" : "2022-02-03",
"creator" : 107,
"definition" : "test_cv3",
"id" : 582,
"itemType" : "SL",
"language" : "en",
"notation" : "test_cv3",
"number" : "1.0",
"status" : "DRAFT",
"title" : "test_cv3",
"versionHistories" : [],
"vocabularyId" : 91
}
],
"withdrawn" : false
}
{
"agencyId" : 1,
"agencyLink" : "https://www.cessda.eu/",
"agencyLogo" : "cessda.png",
"agencyName" : "CESSDA",
"archived" : false,
"codes" : [],
"definitionEn" : "test_cv3",
"discoverable" : true,
"id" : 91,
"notation" : "test_cv3",
"sourceLanguage" : "en",
"status" : "DRAFT",
"titleEn" : "test_cv3",
"versionEn" : "1.0",
"versionNumber" : "1.0",
"versions" : [
{
"comments" : [],
"concepts" : [
{
"definition" : "c1",
"id" : 14631,
"notation" : "c1",
"position" : 0,
"title" : "c1",
"versionId" : 582
},
{
"definition" : "d2",
"id" : 14636,
"notation" : "c2",
"position" : 1,
"title" : "t2",
"versionId" : 582
},
{
"definition" : "d3",
"id" : 14637,
"notation" : "c3",
"position" : 2,
"title" : "t3",
"versionId" : 582
},
{
"definition" : "d4",
"id" : 14638,
"notation" : "c4",
"position" : 3,
"title" : "t4",
"versionId" : 582
}
],
"creationDate" : "2022-02-03",
"creator" : 107,
"definition" : "test_cv3",
"id" : 582,
"itemType" : "SL",
"language" : "en",
"notation" : "test_cv3",
"number" : "1.0",
"status" : "DRAFT",
"title" : "test_cv3",
"versionHistories" : [],
"vocabularyId" : 91
}
],
"withdrawn" : false
}
{
"agencyId" : 1,
"agencyLink" : "https://www.cessda.eu/",
"agencyLogo" : "cessda.png",
"agencyName" : "CESSDA",
"archived" : false,
"codes" : [],
"definitionEn" : "test_cv3",
"discoverable" : true,
"id" : 91,
"notation" : "test_cv3",
"sourceLanguage" : "en",
"status" : "DRAFT",
"titleEn" : "test_cv3",
"versionEn" : "1.0",
"versionNumber" : "1.0",
"versions" : [
{
"comments" : [],
"concepts" : [
{
"definition" : "c1",
"id" : 14631,
"notation" : "c1",
"position" : 0,
"title" : "c1",
"versionId" : 582
}
],
"creationDate" : "2022-02-03",
"creator" : 107,
"definition" : "test_cv3",
"id" : 582,
"itemType" : "SL",
"language" : "en",
"notation" : "test_cv3",
"number" : "1.0",
"status" : "DRAFT",
"title" : "test_cv3",
"versionHistories" : [],
"vocabularyId" : 91
}
],
"withdrawn" : false
}
{
"agencyId" : 1,
"agencyLink" : "https://www.cessda.eu/",
"agencyLogo" : "cessda.png",
"agencyName" : "CESSDA",
"archived" : false,
"codes" : [],
"definitionEn" : "test_cv3",
"discoverable" : true,
"id" : 91,
"notation" : "test_cv3",
"sourceLanguage" : "en",
"status" : "DRAFT",
"titleEn" : "test_cv3",
"versionEn" : "1.0",
"versionNumber" : "1.0",
"versions" : [
{
"comments" : [],
"concepts" : [
{
"definition" : "c1",
"id" : 14631,
"notation" : "c1",
"position" : 0,
"title" : "c1",
"versionId" : 582
}
],
"creationDate" : "2022-02-03",
"creator" : 107,
"definition" : "test_cv3",
"id" : 582,
"itemType" : "SL",
"language" : "en",
"notation" : "test_cv3",
"number" : "1.0",
"status" : "DRAFT",
"title" : "test_cv3",
"versionHistories" : [],
"vocabularyId" : 91
}
],
"withdrawn" : false
}
{
"agencyId" : 1,
"agencyLink" : "https://www.cessda.eu/",
"agencyLogo" : "cessda.png",
"agencyName" : "CESSDA",
"archived" : false,
"codes" : [],
"definitionEn" : "test_cv3",
"discoverable" : true,
"id" : 91,
"notation" : "test_cv3",
"sourceLanguage" : "en",
"status" : "DRAFT",
"titleEn" : "test_cv3",
"versionEn" : "1.0",
"versionNumber" : "1.0",
"versions" : [
{
"comments" : [],
"concepts" : [
{
"definition" : "c1",
"id" : 14631,
"notation" : "c1",
"position" : 0,
"title" : "c1",
"versionId" : 582
}
],
"creationDate" : "2022-02-03",
"creator" : 107,
"definition" : "test_cv3",
"id" : 582,
"itemType" : "SL",
"language" : "en",
"notation" : "test_cv3",
"number" : "1.0",
"status" : "DRAFT",
"title" : "test_cv3",
"versionHistories" : [],
"vocabularyId" : 91
}
],
"withdrawn" : false
}
{
"agencyId" : 1,
"agencyLink" : "https://www.cessda.eu/",
"agencyLogo" : "cessda.png",
"agencyName" : "CESSDA",
"archived" : false,
"codes" : [],
"definitionEn" : "test_cv3",
"discoverable" : true,
"id" : 91,
"notation" : "test_cv3",
"sourceLanguage" : "en",
"status" : "DRAFT",
"titleEn" : "test_cv3",
"versionEn" : "1.0",
"versionNumber" : "1.0",
"versions" : [
{
"comments" : [],
"concepts" : [
{
"definition" : "c1",
"id" : 14631,
"notation" : "c1",
"position" : 0,
"title" : "c1",
"versionId" : 582
}
],
"creationDate" : "2022-02-03",
"creator" : 107,
"definition" : "test_cv3",
"id" : 582,
"itemType" : "SL",
"language" : "en",
"notation" : "test_cv3",
"number" : "1.0",
"status" : "DRAFT",
"title" : "test_cv3",
"versionHistories" : [],
"vocabularyId" : 91
}
],
"withdrawn" : false
}
{
"agencyId" : 1,
"agencyLink" : "https://www.cessda.eu/",
"agencyLogo" : "cessda.png",
"agencyName" : "CESSDA",
"archived" : false,
"codes" : [],
"definitionEn" : "test_cv3",
"discoverable" : true,
"id" : 91,
"notation" : "test_cv3",
"sourceLanguage" : "en",
"status" : "DRAFT",
"titleEn" : "test_cv3",
"versionEn" : "1.0",
"versionNumber" : "1.0",
"versions" : [
{
"comments" : [],
"concepts" : [
{
"definition" : "c1",
"id" : 14631,
"notation" : "c1",
"position" : 0,
"title" : "c1",
"versionId" : 582
},
{
"definition" : "d2",
"id" : 14636,
"notation" : "c2",
"position" : 1,
"title" : "t2",
"versionId" : 582
},
{
"definition" : "d3",
"id" : 14637,
"notation" : "c3",
"position" : 2,
"title" : "t3",
"versionId" : 582
},
{
"definition" : "d4",
"id" : 14638,
"notation" : "c4",
"position" : 3,
"title" : "t4",
"versionId" : 582
}
],
"creationDate" : "2022-02-03",
"creator" : 107,
"definition" : "test_cv3",
"id" : 582,
"itemType" : "SL",
"language" : "en",
"notation" : "test_cv3",
"number" : "1.0",
"status" : "DRAFT",
"title" : "test_cv3",
"versionHistories" : [],
"vocabularyId" : 91
}
],
"withdrawn" : false
}
{
"agencyId" : 1,
"agencyLink" : "https://www.cessda.eu/",
"agencyLogo" : "cessda.png",
"agencyName" : "CESSDA",
"archived" : false,
"codes" : [],
"definitionEn" : "test_cv3",
"discoverable" : true,
"id" : 91,
"notation" : "test_cv3",
"sourceLanguage" : "en",
"status" : "DRAFT",
"titleEn" : "test_cv3",
"versionEn" : "1.0",
"versionNumber" : "1.0",
"versions" : [
{
"comments" : [],
"concepts" : [
{
"definition" : "c1",
"id" : 14631,
"notation" : "c1",
"position" : 0,
"title" : "c1",
"versionId" : 582
},
{
"definition" : "d2",
"id" : 14636,
"notation" : "c2",
"position" : 1,
"title" : "t2",
"versionId" : 582
},
{
"definition" : "d3",
"id" : 14637,
"notation" : "c3",
"position" : 2,
"title" : "t3",
"versionId" : 582
},
{
"definition" : "d4",
"id" : 14638,
"notation" : "c4",
"position" : 3,
"title" : "t4",
"versionId" : 582
}
],
"creationDate" : "2022-02-03",
"creator" : 107,
"definition" : "test_cv3",
"id" : 582,
"itemType" : "SL",
"language" : "en",
"notation" : "test_cv3",
"number" : "1.0",
"status" : "DRAFT",
"title" : "test_cv3",
"versionHistories" : [],
"vocabularyId" : 91
}
],
"withdrawn" : false
}
I’ll check older issues related to caching (e.g., #307, #300), whether there’s something helpful for this issue. Also, inspect concept caching here, and here.
Original comment by Stefan Dlugolinsky (GitHub: Stifo).
I’ve disabled the L2 cache for concepts in Version.java and did the tests again. This time with success. I’ve tested the behavior in staging (test_CV_349). Disabling L2 cache solved the problems with:
However, I’m not sure, how this change affects the performance, when loading concepts. Maybe a different CacheConcurrencyStrategy settings would work as well with slightly better performance (e.g., TRANSACTIONAL), but I do not have experience with it.
Final notes
I consider this issue as resolved.
Original comment by Taina Jääskeläinen.
Added new codes to TestCV, moved some to be child or child of a child, and published. Code ordering worked correctly.
@Stifo what comments did you mean by “L2 caching settings are left for comments”? Comments entered by users?
Original comment by Stefan Dlugolinsky (GitHub: Stifo).
I mean the commented code at line 144 (the first bullet) and comments entered by users in the editor tab - top right “Comments“ button (the second bullet). The same caching mechanism as it was making problems for codes is applied on the CV comments.
Original report on BitBucket by Taina Jääskeläinen.
I added new ExerciseCV to the Editor in staging. Added three codes (Term1, Term2, Term3). After adding a new code and saving, the latest code is sometimes not visible.
https://vocabularies-staging.cessda.eu/editor/vocabulary/ExerciseCV
For example, after adding and saving a fourth code, I only see three terms: Terms 1-3.
After adding a fifth term, both Term4 and Term5 become visible in the table but not in the order entered. They should appear in the order entered. If the user wants to have a different order, they will use ‘Move code’ function. Now they appear in the order: Term 1, Term 2, Term 5, Term 4, Term 3.
You can test this by opening the vocabulary in staging and adding new codes to it with ‘Add code’ function.