Skip to content

Commit

Permalink
Hack to deal with metadata actor bug
Browse files Browse the repository at this point in the history
  • Loading branch information
julianrojas87 committed Mar 5, 2024
1 parent dc867ae commit c1be366
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions packages/actor-init-ldes-client/lib/EventStream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -294,13 +294,16 @@ export class EventStream extends Readable {
* https://semiceu.github.io/LinkedDataEventStreams/example.ttl#eventstream
* gets changed to:
* https://semiceu.github.io/linkeddataeventstreams/example.ttl#eventstream
* which prevents tree:views to get booked
* which prevents tree:views to get booked.
*
* It also removes trailing slashes, which is incorrect.
*/
let safePageUrl = pageUrl.endsWith("/") ? pageUrl.slice(0, -1) : pageUrl;

if (treeMetadata.metadata.treeMetadata.collections.get(pageUrl)
&& treeMetadata.metadata.treeMetadata.collections.get(pageUrl)["view"]) {
if (treeMetadata.metadata.treeMetadata.collections.get(safePageUrl)
&& treeMetadata.metadata.treeMetadata.collections.get(safePageUrl)["view"]) {
// take first view encountered
const view = treeMetadata.metadata.treeMetadata.collections.get(pageUrl)["view"][0]["@id"];
const view = treeMetadata.metadata.treeMetadata.collections.get(safePageUrl)["view"][0]["@id"];
this.bookkeeper.addFragment(view, 0);
this.logger.debug(`Scheduled TREE view (${view}) for retrieval`);
} else if (treeMetadata.metadata.treeMetadata.collections.get(pageUrlWithoutWWW)
Expand Down

0 comments on commit c1be366

Please sign in to comment.