-
Notifications
You must be signed in to change notification settings - Fork 409
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
Don't use sjson.GetTypeOfValue
where it shouldn't be used
#2728
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They happen to do the same thing.
sjson
layer is responsible for preserving BSON-type information in storage. Currently, we store type information in the special schema field. For example, for "64-bit binary floating point" value, we store a string "double". That string could be replaced with a number or even a bitmask as long as we preserve backward compatibility for client applications (and not even that if we bump a major version).
Type aliases are fixed and cannot be changed without breaking compatibility with MongoDB.
What we need to do instead is:
- make this difference clear from code doc comments;
- check that we don't use a wrong function somewhere (spoiler: we do at least in once place)
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #2728 +/- ##
===========================================
- Coverage 63.04% 26.19% -36.85%
===========================================
Files 441 441
Lines 22619 22619
===========================================
- Hits 14260 5926 -8334
- Misses 7434 16087 +8653
+ Partials 925 606 -319
... and 143 files with indirect coverage changes
Flags with carried forward coverage won't be shown. Click here to find out more. |
c413615
to
99f1842
Compare
sjson.GetTypeOfValue
helpersjson.GetTypeOfValue
where it shouldn't be used
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👌
Description
Readiness checklist
task all
, and it passed.@FerretDB/core
), Labels, Project and project's Sprint fields.