veracitylab / provenance-injector

inject provenance into JEE applications
Apache License 2.0
0 stars 0 forks source link

`GlobalProvenanceTracker` returns no invocations, despite invocations occurring #17

Closed wtwhite closed 4 months ago

wtwhite commented 4 months ago

Root cause: GlobalProvenanceTracker::pickup() actually does return a fully populated list -- but GlobalProvenanceTracker::cull() is called right after it, and that clears the same list, making it appear to have never contained anything.

This is not an issue in the original ProvenanceInfoPickupServlet here in this repo, since that encodes the list before calling cull() -- but it did affect a new provenance pickup endpoint I wrote for a Spring Boot app. Modifying returned lists after the fact is a footgun in general, so best to fix it here.

Wrapping pickup()'s return value in List.copyOf() fixes the issue. PR incoming.