Details
-
Bug
-
Resolution: Fixed
-
Major
-
0.10
Description
IndexWorker reacts to any page that carries an AI.Documents.Code.DocumentsClass object. When such an object is removed or its page deleted, it deletes the chunks for the collection and document id named in the object (deleteChunksByDocIdAndStore(wiki, collection, id, "internal")), without checking that the page is the canonical page of that document. A user with edit right on any page can add an object with collection=X, id=Y and remove it again: the chunks of the real document Y of collection X disappear from search until that document is next saved. Adding the object also queues an indexing run, which costs embedding calls.
Expected / proposal: Act only when the page is the canonical document page, AI.Collections.<collection>.Documents.<sha256(id)>; ignore documents objects anywhere else (for indexing and for deletion alike).