This is an automated email from the ASF dual-hosted git repository.

vatamane pushed a commit to branch check-for-vdu-in-quickjs-scanner
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 076c94bd9f54033306309649d15cbc3d04588fe7
Author: Nick Vatamaniuc <[email protected]>
AuthorDate: Thu May 16 20:08:57 2024 -0400

    Handle missing VDU better in In QuickJS scanner plugin
    
    Previously we tried to run the VDU query prompt even if there was not VDU. 
That
    would have yielded a match anyway as both result in an error, but it added
    noise to the logs.
    
    Handle the missing VDU like we handle the missing filters in
    filter_doc_validate.
---
 src/couch_quickjs/src/couch_quickjs_scanner_plugin.erl | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/couch_quickjs/src/couch_quickjs_scanner_plugin.erl 
b/src/couch_quickjs/src/couch_quickjs_scanner_plugin.erl
index a30b7b687..f6521303c 100644
--- a/src/couch_quickjs/src/couch_quickjs_scanner_plugin.erl
+++ b/src/couch_quickjs/src/couch_quickjs_scanner_plugin.erl
@@ -401,6 +401,9 @@ vdu_load(#st{qjs_proc = Qjs, sm_proc = Sm}, VDU) ->
         false -> throw({validate, {vdu, QjsRes, SmRes}})
     end.
 
+vdu_doc_validate(#st{}, _DDocId, undefined, _Doc) ->
+    % No VDU
+    ok;
 vdu_doc_validate(#st{} = St, DDocId, _VDU, Doc) ->
     #st{qjs_proc = Qjs, sm_proc = Sm} = St,
     QjsRes = vdu_doc(Qjs, DDocId, Doc),

Reply via email to