Incorrect total record count #273

Open
opened 2025-12-10 14:21:48 +00:00 by jsheunis · 2 comments
jsheunis commented 2025-12-10 14:21:48 +00:00 (Migrated from github.com)

E.g. after submitting a record to token-protected collection:

Image

There is only 1 record, but it shows "1/2".

Looking at the response data stored by shacl-vue, printed to console:

fetchFromService result.url: [ShaclVue.vue:1015:17](https://pool.psychoinformatics.de/src/components/ShaclVue.vue)
Array [ {…}, {…} ]
​
0: Object { url: "https://pool.psychoinformatics.de/api/protected/records/p/XYZPerson?format=ttl&size=100&page=1", success: true, skipped: false, … }
​​
pageMeta: Object { page: 1, pages: 1, total: 1, … }
​page: 1
​​pages: 1
​​​size: 100
​​​total: 1
​​​<prototype>: Object { … }
​​skipped: false
​​success: true
​​url: "https://pool.psychoinformatics.de/api/protected/records/p/XYZPerson?format=ttl&size=100&page=1"
​​<prototype>: Object { … }
​
1: Object { url: "https://pool.psychoinformatics.de/api/public/records/p/XYZPerson?format=ttl&size=100&page=1", success: true, skipped: false, … }
​​
pageMeta: Object { page: 1, pages: 1, total: 1, … }
​​​
page: 1
​​​pages: 1
​​​size: 100
​​​total: 1
​​​<prototype>: Object { … }
​​skipped: false
​​success: true
​​url: "https://pool.psychoinformatics.de/api/public/records/p/XYZPerson?format=ttl&size=100&page=1"
​​<prototype>: Object { … }

Both the public and protected urls show the total as being 1, but that is only true for the protected url. The public one should be total 0.

This suggests that there is a bug in the way that pageMeta is assigned in the useData composable: https://github.com/psychoinformatics-de/shacl-vue/blob/main/src/composables/useData.js

E.g. after submitting a record to token-protected collection: <img width="1074" height="444" alt="Image" src="https://github.com/user-attachments/assets/42604adb-84ad-4dc9-a6ed-ed0ea9c50761" /> There is only 1 record, but it shows "1/2". Looking at the response data stored by `shacl-vue`, printed to console: ``` fetchFromService result.url: [ShaclVue.vue:1015:17](https://pool.psychoinformatics.de/src/components/ShaclVue.vue) Array [ {…}, {…} ] ​ 0: Object { url: "https://pool.psychoinformatics.de/api/protected/records/p/XYZPerson?format=ttl&size=100&page=1", success: true, skipped: false, … } ​​ pageMeta: Object { page: 1, pages: 1, total: 1, … } ​page: 1 ​​pages: 1 ​​​size: 100 ​​​total: 1 ​​​<prototype>: Object { … } ​​skipped: false ​​success: true ​​url: "https://pool.psychoinformatics.de/api/protected/records/p/XYZPerson?format=ttl&size=100&page=1" ​​<prototype>: Object { … } ​ 1: Object { url: "https://pool.psychoinformatics.de/api/public/records/p/XYZPerson?format=ttl&size=100&page=1", success: true, skipped: false, … } ​​ pageMeta: Object { page: 1, pages: 1, total: 1, … } ​​​ page: 1 ​​​pages: 1 ​​​size: 100 ​​​total: 1 ​​​<prototype>: Object { … } ​​skipped: false ​​success: true ​​url: "https://pool.psychoinformatics.de/api/public/records/p/XYZPerson?format=ttl&size=100&page=1" ​​<prototype>: Object { … } ``` Both the `public` and `protected` urls show the total as being 1, but that is only true for the `protected` url. The `public` one should be total 0. This suggests that there is a bug in the way that `pageMeta` is assigned in the `useData` composable: https://github.com/psychoinformatics-de/shacl-vue/blob/main/src/composables/useData.js
jsheunis commented 2025-12-10 20:11:38 +00:00 (Migrated from github.com)

The issue is not in shacl-vue. Rather, it is the result of shacl-vue not understanding and not being able to react to a specific configuration setup of dumpthings.

In this example above, the dumpthings backend has two collections: public and protected. If I make a request to the public collection, using my forgejo-generated token (where my forgejo user is part of the curator and protected-write teams), then I get a record which isn't in the public collection but only in the incoming area of my user/token-collection. That was unexpected. The expected part was that when the same request is made to the protected collection, the record in the incoming area of my user/token-collection is returned (which is where the record was posted to in the first place).

This happens because of two reasons:

  • If you make a request as a user (to e.g. /<collection>/records/p/XYZPerson) you get the curated records and the records from your inbox in that collection. If two records have identical PIDs, the inbox record is returned, because it is favored.
  • the inbox of both collections in this example pointed to the same on-disk location, i.e. the protected and public inboxes were the same thing.

shacl-vue can't know this. So to solve it for this particular case, the inboxes can be separated. In the more general case, I am not sure.

The issue is not in `shacl-vue`. Rather, it is the result of `shacl-vue` not understanding and not being able to react to a specific configuration setup of `dumpthings`. In this example above, the `dumpthings` backend has two collections: `public` and `protected`. If I make a request to the `public` collection, using my forgejo-generated token (where my forgejo user is part of the curator and protected-write teams), then I get a record which isn't in the public collection but only in the incoming area of my user/token-collection. That was unexpected. The expected part was that when the same request is made to the `protected` collection, the record in the incoming area of my user/token-collection is returned (which is where the record was posted to in the first place). This happens because of two reasons: - If you make a request as a user (to e.g. `/<collection>/records/p/XYZPerson`) you get the curated records and the records from your inbox _in that collection_. If two records have identical PIDs, the inbox record is returned, because it is favored. - the inbox of both collections in this example pointed to the same on-disk location, i.e. the `protected` and `public` inboxes were the same thing. `shacl-vue` can't know this. So to solve it for this particular case, the inboxes can be separated. In the more general case, I am not sure.
Owner

I believe (some) of this is now resolved by using different inboxes for each collections (instead of a joint inbox for all collections).

I believe (some) of this is now resolved by using different inboxes for each collections (instead of a joint inbox for all collections).
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
orinoco/shacl-vue#273
No description provided.