Skip to content

Conversation

@KazaiMazai
Copy link
Owner

@KazaiMazai KazaiMazai commented Nov 20, 2025

Note

Deprecates parameterless resolve() and adds resolve(in:) across Query, QueryList, QueryGroup, and collections of queries to require explicit context.

  • Queries API:
    • Deprecate parameterless resolve() in Query, QueryList, QueryGroup, and Collection of Query.
    • Add context-explicit resolve(in:) counterparts requiring a Context.
    • Wire up helpers (resolveQueries(), whenResolved, etc.) to use the new resolve flow.

Written by Cursor Bugbot for commit 4e1c11b. This will update automatically on new commits. Configure here.

@KazaiMazai KazaiMazai self-assigned this Nov 20, 2025
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

This PR is being reviewed by Cursor Bugbot

Details

You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.


func resolve(in context: Context) -> [[Entity]] {
resolveQueries().compactMap { $0.resolve() }
}
Copy link

Choose a reason for hiding this comment

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

Bug: Context parameter ignored in new resolve method

The new resolve(in context:) method accepts a context parameter but doesn't use it. Instead, it calls resolveQueries() which uses the stored self.context, and then resolves each query using their own stored contexts. The provided context parameter is completely ignored, making this method functionally identical to the deprecated version and defeating the purpose of explicitly providing context.

Fix in Cursor Fix in Web


func resolve(in context: Context) -> [Entity] {
resolveQueries().resolve()
}
Copy link

Choose a reason for hiding this comment

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

Bug: Context parameter ignored in new resolve method

The new resolve(in context:) method accepts a context parameter but doesn't use it. Instead, it calls resolveQueries() which uses the stored self.context, and then calls the deprecated resolve() method on the collection which uses each query's stored context. The provided context parameter is completely ignored, making this method functionally identical to the deprecated version and defeating the purpose of explicitly providing context.

Fix in Cursor Fix in Web


func resolve(in context: Context) -> Entity? {
result(context, id)
}
Copy link

Choose a reason for hiding this comment

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

Bug: Key computed with wrong context in resolve

The new resolve(in context:) method passes the provided context parameter to the result closure but uses id which is computed from self.context via the key closure. This mixes two different contexts: the key is derived from the stored context while the result lookup uses the provided context. The key should be computed using the provided context parameter to maintain consistency.

Fix in Cursor Fix in Web


func resolve<Entity>(in context: Context) -> [Entity] where Element == Query<Entity> {
compactMap { $0.resolve() }
}
Copy link

Choose a reason for hiding this comment

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

Bug: Collection resolve ignores context parameter

The new resolve(in context:) method for collections accepts a context parameter but calls the deprecated resolve() method without passing the context. This means the provided context is ignored and each query uses its own stored context instead of the explicitly provided one.

Fix in Cursor Fix in Web

@KazaiMazai KazaiMazai merged commit 88f431b into main Nov 20, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants