janl commented on code in PR #4673:
URL: https://github.com/apache/couchdb/pull/4673#discussion_r1296850568


##########
src/couch/src/couch_db.erl:
##########
@@ -1458,23 +1567,29 @@ collect_results(Pid, MRef, ResultsAcc) ->
     end.
 
 write_and_commit(
-    #db{main_pid = Pid, user_ctx = Ctx} = Db,
+    #db{main_pid = Pid, user_ctx = UserCtx0} = Db,
     DocBuckets1,
     LocalDocs,
     Options
 ) ->
     DocBuckets = prepare_doc_summaries(Db, DocBuckets1),
     ReplicatedChanges = lists:member(?REPLICATED_CHANGES, Options),
     MRef = erlang:monitor(process, Pid),
+    UserCtx =
+        case has_access_enabled(Db) of
+            true -> UserCtx0;
+            false -> []
+        end,
+
     try
-        Pid ! {update_docs, self(), DocBuckets, LocalDocs, ReplicatedChanges},
+        Pid ! {update_docs, self(), DocBuckets, LocalDocs, ReplicatedChanges, 
UserCtx},

Review Comment:
   afaict, `couch_db_updater:update_docs` is only ever called from a local 
`couch_db_updater` process, as it is the only process that knows its `Pid`



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

Reply via email to