SolidOS/solid-ui

autocompleteField tests fail with latest rdflib@2.2.26

Opened this issue · 2 comments

solid-ui branch applyPatch includes latest rdflib@2.2.26 and solid-logic@3.0.0 changes
rdflib@2.2.26 merge PR linkeddata/rdflib.js#574

This rdflib PR introduce errors in the autocompleteField tests in solid-UI

I tested the full stack with watch on NSS localhost
I think the autocompleteField is used in updating profile.
I did not find any issue running NSS localhost to update the profile card with things coming from wikidata.

Is the issue on solid-ui tests or on latest rdflib@2.2.26 ?

@timbl can you have a look ?

reverting linkeddata/rdflib.js@0aa5764 did not resolve the issue.
The issue was in reverting jsonld v8 an ES module back to v5 and commonjs
jsonld is used in rdflib jsonldParser.js

All 3 solutions where tried to keep latest jsonld@8 ES module

  1. run jest with experimental ECMA script module https://jestjs.io/docs/ecmascript-modules#differences-between-esm-and-commonjs --> errors in the autocompleteField tests in solid-UI
  2. use dynamic import of jsonld@8 in rdflib jsonldParser.js with or without jest experimental ECMA script
    --> segmentation fault on github actions (locally test passed without any issue)
  3. try to solve the above segmentation fault following jestjs/jest#10662
    nothing worked 094a738 and all other examples in https://github.com/SolidOS/solid-ui/tree/rdflib

@bourgeoa I'm still looking but I believe it has to do with fetch. It's in here

export async function queryPublicDataByName (
somewhere with the store.fetcher... I do remember something about the fetch, I will have to look at it more tomorrow. Maybe we need to mock it or send a different fetch in.

console.error errorMessageBlock: Error: Error querying db of organizations: Error: Fetch error for GET of <https://query.wikidata.org/sparql?query=SELECT+%3Fsubject+%3Fname%0A++++++++WHERE+%7B%0A++++++++++%3Fklass+wdt%3AP279*+%3Chttp%3A%2F%2Fwww.wikidata.org%2Fentity%2FQ6881511%3E+.%0A++++++++++%3Fsubject+wdt%3AP31+%3Fklass+.%0A++++++++++%3Fsubject+rdfs%3Alabel+%3Fname.%0A++++++++++FILTER+regex%28%3Fname%2C+%22mass%22%2C+%22i%22%29%0A++++++++%7D+LIMIT+200+>:TypeError: window.fetch is not a function at: Error: Error querying db of organizations: Error: Fetch error for GET of <https://query.wikidata.org/sparql?query=SELECT+%3Fsubject+%3Fname%0A++++++++WHERE+%7B%0A++++++++++%3Fklass+wdt%3AP279*+%3Chttp%3A%2F%2Fwww.wikidata.org%2Fentity%2FQ6881511%3E+.%0A++++++++++%3Fsubject+wdt%3AP31+%3Fklass+.%0A++++++++++%3Fsubject+rdfs%3Alabel+%3Fname.%0A++++++++++FILTER+regex%28%3Fname%2C+%22mass%22%2C+%22i%22%29%0A++++++++%7D+LIMIT+200+>:TypeError: window.fetch is not a function at complain (/Users/sharon/2023Development/solid-ui/src/widgets/forms/autocomplete/autocompletePicker.ts:62:17) at _callee5$ (/Users/sharon/2023Development/solid-ui/src/widgets/forms/autocomplete/autocompletePicker.ts:147:7) at tryCatch (/Users/sharon/2023Development/solid-ui/node_modules/@babel/runtime/helpers/regeneratorRuntime.js:44:17) at Generator.<anonymous> (/Users/sharon/2023Development/solid-ui/node_modules/@babel/runtime/helpers/regeneratorRuntime.js:125:22) at Generator.throw (/Users/sharon/2023Development/solid-ui/node_modules/@babel/runtime/helpers/regeneratorRuntime.js:69:21) at asyncGeneratorStep (/Users/sharon/2023Development/solid-ui/node_modules/@babel/runtime/helpers/asyncToGenerator.js:3:24) at _throw (/Users/sharon/2023Development/solid-ui/node_modules/@babel/runtime/helpers/asyncToGenerator.js:25:9) Error: Error querying db of organizations: Error: Fetch error for GET of <https://query.wikidata.org/sparql?query=SELECT+%3Fsubject+%3Fname%0A++++++++WHERE+%7B%0A++++++++++%3Fklass+wdt%3AP279*+%3Chttp%3A%2F%2Fwww.wikidata.org%2Fentity%2FQ6881511%3E+.%0A++++++++++%3Fsubject+wdt%3AP31+%3Fklass+.%0A++++++++++%3Fsubject+rdfs%3Alabel+%3Fname.%0A++++++++++FILTER+regex%28%3Fname%2C+%22mass%22%2C+%22i%22%29%0A++++++++%7D+LIMIT+200+>:TypeError: window.fetch is not a function at complain (/Users/sharon/2023Development/solid-ui/src/widgets/forms/autocomplete/autocompletePicker.ts:62:17) at _callee5$ (/Users/sharon/2023Development/solid-ui/src/widgets/forms/autocomplete/autocompletePicker.ts:147:7) at tryCatch (/Users/sharon/2023Development/solid-ui/node_modules/@babel/runtime/helpers/regeneratorRuntime.js:44:17) at Generator.<anonymous> (/Users/sharon/2023Development/solid-ui/node_modules/@babel/runtime/helpers/regeneratorRuntime.js:125:22) at Generator.throw (/Users/sharon/2023Development/solid-ui/node_modules/@babel/runtime/helpers/regeneratorRuntime.js:69:21) at asyncGeneratorStep (/Users/sharon/2023Development/solid-ui/node_modules/@babel/runtime/helpers/asyncToGenerator.js:3:24) at _throw (/Users/sharon/2023Development/solid-ui/node_modules/@babel/runtime/helpers/asyncToGenerator.js:25:9)