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

[FIX] nullable conversions #3316

Merged
merged 3 commits into from
Jul 19, 2022

Conversation

tomasfil
Copy link
Contributor

Current implementation doesnt respect the possibility to assign null on null/empty string.

This potentially Fixes #3166.

But this might be breaking change, so I am not sure if it is good idea.

I have personally already stumbled on this issue few times and caused me headache, but never got into checking what is the issue.

Because when I declare number as nullable, then I expect it to be null, when I delete the text from TextBox. The way it is now is counter intuitive.

The fix makes sense to me, but could break lot of apps relying in that """feature""".

@glennawatson
Copy link
Contributor

If you can fix the compile errors your changes look good. Can approve it.

@codecov
Copy link

codecov bot commented Jul 19, 2022

Codecov Report

Merging #3316 (fef4a49) into main (f6aa117) will decrease coverage by 0.22%.
The diff coverage is 33.33%.

@@            Coverage Diff             @@
##             main    #3316      +/-   ##
==========================================
- Coverage   63.83%   63.60%   -0.23%     
==========================================
  Files         157      157              
  Lines        5726     5768      +42     
==========================================
+ Hits         3655     3669      +14     
- Misses       2071     2099      +28     
Impacted Files Coverage Δ
...ngs/Converter/NullableLongToStringTypeConverter.cs 12.50% <0.00%> (-4.17%) ⬇️
...ngs/Converter/NullableByteToStringTypeConverter.cs 66.66% <33.33%> (-11.12%) ⬇️
.../Converter/NullableDecimalToStringTypeConverter.cs 62.96% <33.33%> (-8.47%) ⬇️
...s/Converter/NullableDoubleToStringTypeConverter.cs 62.96% <33.33%> (-8.47%) ⬇️
...gs/Converter/NullableShortToStringTypeConverter.cs 66.66% <33.33%> (-11.12%) ⬇️
...s/Converter/NullableSingleToStringTypeConverter.cs 62.96% <33.33%> (-8.47%) ⬇️
.../Converter/NullableIntegerToStringTypeConverter.cs 79.16% <66.66%> (-4.17%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f6aa117...fef4a49. Read the comment docs.

@tomasfil
Copy link
Contributor Author

tomasfil commented Jul 19, 2022

The build should go through now, missed space..

Are you not afraid of breaking changes resulting from this? I can imagine some app scenarios accidentally building around this bug

But it is actual bug (not idiomatic), so yeah, propably worth trade off

@glennawatson glennawatson merged commit cc156c6 into reactiveui:main Jul 19, 2022
@tomasfil tomasfil deleted the FixingNullableConversion branch July 19, 2022 19:20
@github-actions
Copy link

github-actions bot commented Aug 3, 2022

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Databinding to Nullable Integer Property Does Not Properly Handle Null or Empty String
2 participants