Copilot commented on code in PR #2938:
URL: 
https://github.com/apache/incubator-hugegraph/pull/2938#discussion_r2689969896


##########
hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/schema/builder/EdgeLabelBuilder.java:
##########
@@ -670,7 +667,16 @@ private void checkStableVars() {
         }
     }
 
-    private void checkTtl() {
+    private void updateTTL(EdgeLabel edgeLabel) {
+        if (this.ttl > 0L) {
+            edgeLabel.ttl(this.ttl);
+            if (this.ttlStartTime != null) {
+                
edgeLabel.ttlStartTime(this.graph().propertyKey(this.ttlStartTime).id());

Review Comment:
   The updateTTL method only updates TTL when ttl > 0, but this prevents 
clearing TTL by setting it to 0. When appending, if ttl is explicitly set to 0, 
it should be applied to allow removal of TTL from a label that previously had 
TTL configured.
   ```suggestion
           /*
            * Update ttl in two cases:
            * 1) ttl > 0L: set or change a positive ttl;
            * 2) ttl == 0L and existing ttl > 0L: explicitly clear an existing 
ttl.
            * This allows removing ttl from a label that previously had ttl 
configured.
            */
           if (this.ttl > 0L || (this.ttl == 0L && edgeLabel.ttl() > 0L)) {
               edgeLabel.ttl(this.ttl);
               if (this.ttlStartTime != null) {
                   edgeLabel.ttlStartTime(
                           this.graph().propertyKey(this.ttlStartTime).id());
   ```



##########
hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/schema/builder/VertexLabelBuilder.java:
##########
@@ -546,7 +533,16 @@ private void checkStableVars() {
         }
     }
 
-    private void checkTtl() {
+    private void updateTTL(VertexLabel vertexLabel) {
+        if (this.ttl > 0L) {
+            vertexLabel.ttl(this.ttl);
+            if (this.ttlStartTime != null) {
+                
vertexLabel.ttlStartTime(this.graph().propertyKey(this.ttlStartTime).id());
+            }
+        }
+    }

Review Comment:
   The updateTTL method only updates TTL when ttl > 0, but this prevents 
clearing TTL by setting it to 0. When appending, if ttl is explicitly set to 0, 
it should be applied to allow removal of TTL from a label that previously had 
TTL configured.



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to