Skip to content

Fix: find all intersected sets regardless of availablility#21

Merged
joe-allen-89 merged 2 commits intomasterfrom
issue/19
Sep 17, 2025
Merged

Fix: find all intersected sets regardless of availablility#21
joe-allen-89 merged 2 commits intomasterfrom
issue/19

Conversation

@danielghost
Copy link
Copy Markdown
Contributor

Fixes #19.

Fix

  • Find all intersected sets regardless of availablility, when using a modelId - now consistent with other intersection queries
  • Allows sets to update to availability changes on their intersections

@oliverfoster
Copy link
Copy Markdown
Member

oliverfoster commented Jul 10, 2025

This begs the question of whether all of the core behaviour should be _isAvailable agnostic and availability should only be checked at the end, i.e. when calculating scores etc. It does seem very weird having a "raw" versions of questions, components, etc rather than an "available" version of questions, components, etc.

The consequence of this PR is that intersection sets will always return the components, questions etc of their this.rawModels only, rather than the components, questions etc of their intersected set models. And therefore all of the score properties will only return the score for this.rawModels, regardless of the intersections. I don't think this is what you intended?

Copy link
Copy Markdown
Member

@oliverfoster oliverfoster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awaiting response to previous outline of changes

@oliverfoster
Copy link
Copy Markdown
Member

oliverfoster commented Jul 23, 2025

Summary of our conversation offline:

This will break all intersecting subset queries that use createIntersectionSubset. Including getSubsets, getSubsetsByType, getSubsetsByModelId, getSubsetsById, getSubsetsByPath and getSubsetsByQuery. This change will stop the resultant intersecting set from having reduced models. Those functions rely on an unbroken this.filterModels(models) chain, which reduces the models based on this.subsetParent intersections.

As it has been used in production and a version two is on the way imminently, which will fix/revert this change. I will approve to get the changes into the repo history.

Copy link
Copy Markdown
Member

@oliverfoster oliverfoster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With caveats that it will be reverted quickly.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👀

@joe-allen-89 joe-allen-89 merged commit 1d84fb5 into master Sep 17, 2025
1 check passed
@github-project-automation github-project-automation bot moved this from Needs Reviewing to Recently Released in adapt_framework: The TODO Board Sep 17, 2025
github-actions bot pushed a commit that referenced this pull request Sep 17, 2025
## [1.2.2](v1.2.1...v1.2.2) (2025-09-17)

### Fix

* find all intersected sets regardless of availablility (fixes #21) ([1d84fb5](1d84fb5)), closes [#21](#21) [#19](#19)
@github-actions
Copy link
Copy Markdown

🎉 This PR is included in version 1.2.2 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inconsistency with intersection queries and available subsets

4 participants