Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop throwing eagerly when looking up a ValueGenerator #32930

Merged
merged 3 commits into from
Feb 5, 2024

Conversation

ajcvickers
Copy link
Member

Fixes #32892

The issue was introduced by the fix for stable/unstable values. In that fix, we were missing that a value generator exists and influences whether the generated value is considered stable or not. However, some types, most notably bools, don't have a default generator. This is fine, it just means that there isn't a generator to use.

I removed the exception entirely because we never now throw if we can't find a generator--it's always okay. This is technically a breaking change, and people do create their own selectors, so we should probably doc it.

@ajcvickers ajcvickers requested a review from a team January 26, 2024 14:20
@SamMonoRT
Copy link
Member

The #32892 has been marked as a Servicing Consider 8.0.x label. The description above indicates this is a breaking change.
Question - Do we really want to backport this?

@ajcvickers
Copy link
Member Author

@SamMonoRT We may want to do a somewhat less clean version of the fix that isn't a break when take this to the servicing branch. I would like to hear what the @dotnet/efteam thinks.

@AndriySvyryd
Copy link
Member

I think we should still throw this for non-composite keys, as it would be a more useful exception than a "key not set"

@ajcvickers
Copy link
Member Author

@AndriySvyryd @SamMonoRT New version up that retains the behavior of throwing for non-composite keys. Also changed the break into an obsolete.

We can't port this directly to release/8.0, but if this is the correct fix going forward, then I'll look at the port next.

Fixes #32892

The issue was introduced by the fix for stable/unstable values. In that fix, we were missing that a value generator exists and influences whether the generated value is considered stable or not. However, some types, most notably bools, don't have a default generator. This is fine, it just means that there isn't a generator to use.

I removed the exception entirely because we never now throw if we can't find a generator--it's always okay. This is technically a breaking change, and people do create their own selectors, so we should probably doc it.
…e keys set for generation without any generator.
@ajcvickers ajcvickers merged commit 838ae11 into main Feb 5, 2024
7 checks passed
@ajcvickers ajcvickers deleted the 240126_Length2933 branch February 5, 2024 09:48
roji pushed a commit to roji/efcore that referenced this pull request Feb 9, 2024
* Stop throwing eagerly when looking up a ValueGenerator

Fixes dotnet#32892

The issue was introduced by the fix for stable/unstable values. In that fix, we were missing that a value generator exists and influences whether the generated value is considered stable or not. However, some types, most notably bools, don't have a default generator. This is fine, it just means that there isn't a generator to use.

I removed the exception entirely because we never now throw if we can't find a generator--it's always okay. This is technically a breaking change, and people do create their own selectors, so we should probably doc it.

* Update to remove the breaking change and still throw for non-composite keys set for generation without any generator.

* Remove interface default implementation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants