-
Notifications
You must be signed in to change notification settings - Fork 172
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
Harmonize check on class name length #7175
Conversation
2652252
to
2283bac
Compare
2283bac
to
9e85c15
Compare
Pull Request Test Coverage Report for Build jorgen.edelbo_1
💛 - Coveralls |
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.
I don't think this is actually what would make client reset crash, but the change looks fine to me and is certainly less confusing than subtracting six from a constant.
@jbreams do you think this PR is in such a good shape that you would be able to actually approve it? 😄 |
I hope you agree that the check actually was wrong before. |
@@ -293,6 +296,7 @@ class Group : public ArrayParent { | |||
using TableNameBuffer = std::array<char, max_table_name_length>; | |||
static StringData class_name_to_table_name(StringData class_name, TableNameBuffer& buffer) | |||
{ | |||
REALM_ASSERT(class_name.size() <= max_class_name_length); |
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.
should we add a similar assertion to table_name_to_class_name
?
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.
I don't think there would be a point in that. It just returns a substring.
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.
yes, but table_name
is not supposed to have more than 63 characters
CHANGELOG.md
Outdated
@@ -8,6 +8,7 @@ | |||
### Fixed | |||
* <How do the end-user experience this issue? what was the impact?> ([#????](https://github.com/realm/realm-core/issues/????), since v?.?.?) | |||
* Update existing std exceptions thrown by the Sync Client to use Realm exceptions. ([#6255](https://github.com/realm/realm-core/issues/6255), since v10.2.0) | |||
* Having a class name of length 57 would make client reset crash ([#7176](https://github.com/realm/realm-core/issues/7176), since v10.0.0) |
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.
is it that a class name of length 57 (63-6) should be allowed whereas before it was up to 56? I think this should be mentioned because it is not clear what this is fixing.
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.
LGTM mod minor changes
What, How & Why?
Fixes #7177
☑️ ToDos
bindgen/spec.yml
, if public C++ API changed