Skip to content

Filtering in getGlobalScope #1311

Answered by msujew
antoinelilly asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @antoinelilly,

I haven't tried out your code yet, but I'm fairly sure the way you are performing the caching in the last line leads to a few issues. Basically, the first time any scoping happens for a given referenceType, the new MapScope(this.indexManager.allElements(referenceType, uris)) value will be cached for it. Afterwards, even for different documents (which will result in a different set of uris), it will reuse the same scope that was stored the first time. You cannot use the global scope cache if your global scope is on a per-document basis.

Does it work as expected if you remove the caching in the last step and instead return the MapScope directly?

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@antoinelilly
Comment options

Answer selected by antoinelilly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants