Opened 2 years ago

Closed 2 years ago

#2220 closed defect (fixed)

Some SourceItemTransformer implementations can't be used for more than one transform

Reported by: Nicklas Nordborg Owned by: everyone
Priority: major Milestone: BASE 3.17
Component: core Version:
Keywords: Cc:

Description

The SourceItemTransformer API is mainly used by the item list functionality to implement the synchronization filters functionality. Now, the idea is to use the API also for implementing #2218. While testing out this it was discovered that in some cases the implementation of the SourceItemTransformer.transform() method would return incorrect results if called more than once. The main suspect is the transitions from Extract to Derived bioassay (in both directions) that uses the CollectExtracts to keep track of extracts in order to later be able to select the correct path when continuing up- or downstream. The collected extracts need to be cleared each time the transform() method is used otherwise the transformer will include extracts from the first call also on the second call, and so on.

There is no simple way to test this yet, so I think the first thing is to implement a test case.

Change History (2)

comment:1 Changed 2 years ago by Nicklas Nordborg

In 7837:

References #2220: Some SourceItemTransformer? implementations can't be used for more than one transform

Implemented a test case for the some SourceItemTransform implementations. The test case is focused on the part between the Extract and Derived bioassay levels, since that is were the issue appears. Implementations that go further up- and downstream are also affected.

comment:2 Changed 2 years ago by Nicklas Nordborg

Resolution: fixed
Status: newclosed

In 7838:

Fixes #2220: Some SourceItemTransformer? implementations can't be used for more than one transform

The CollectExtracts implementation now wraps the first transformer it creates with an instance that reset the collected extracts.

Note: See TracTickets for help on using tickets.