stefan-egli commented on code in PR #560:
URL: https://github.com/apache/jackrabbit-oak/pull/560#discussion_r873914768
##########
oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeState.java:
##########
@@ -414,6 +414,11 @@ public String toString() {
* @param revision the revision this node is created.
*/
UpdateOp asOperation(@NotNull Revision revision) {
+
+ if (Utils.isNodeNameLong(path,
store.getDocumentStore().getNodeNameLimit())) {
+ throw new DocumentStoreException("Node name is too long: " + path);
+ }
+
Review Comment:
Actually I still think this does not cover all cases, now that
`Utils.getIdFromPath` doesn't do the check anymore.
What about moving the check to `UpdateOp` 's constructor, where it
initializes the `id`?
Any add/modify write to DocumentStore goes through an `UpdateOp` - so if you
can avoid creating a faulty (too-long node-name) `UpdateOp` you'd be fine.
Alternatively it could be done in the DocumentStore's implementations - but
that would multiply the changes again and perhaps open doors for missing it in
some. So `UpdateOp` sounds like a central piece where this could be applied.
Wdyt?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]