OpenTermsArchive / engine

Tracks contractual documents and exposes changes to the terms of online services.
https://opentermsarchive.org
European Union Public License 1.2
111 stars 30 forks source link

Cannot read properties of `undefined` (reading 'service') #1012

Closed MattiSG closed 1 year ago

MattiSG commented 1 year ago

As described in https://github.com/OpenTermsArchive/pga-declarations/issues/157: following an upgrade from v0.24 to v0.29, in the PGA collection, the module that updates issues on GitHub fails on every run with the following error:

unhandledRejection: Cannot read properties of undefined (reading 'service')
TypeError: Cannot read properties of undefined (reading 'service')
at Function.formatIssueTitleAndBody (…/pga/node_modules/@opentermsarchive/engine/src/tracker/index.js:183:41)
at Tracker.onInaccessibleContent (…/pga/node_modules/@opentermsarchive/engine/src/tracker/index.js:73:37)
at Archivist.emit (node:events:525:35)

This does not seem to block runs since snapshots are still updated. However, I see no new version since then, so it could be that versions are not properly extracted anymore (it could also just be coincidence).

I had never seen that error before. The faulting line (src/tracker/index.js:183) has not been changed in the last three months. I see no related breaking changes in the Changelog.

It seems that one instance of terms cannot be destructured because it does not contain the service property. I checked and every service declared in PGA has a name.