MCPcopy
hub / github.com/UdaraJay/Pile / updateParentOfReply

Method updateParentOfReply

src/main/utils/pileIndex.js:159–176  ·  view source on GitHub ↗
(replyPath)

Source from the content-addressed store, hash-verified

157 // reply's parent needs to be found by checking every non isReply entry and
158 // see if it's included in the replies array of the parent
159 updateParentOfReply(replyPath) {
160 const reply = this.index.get(replyPath);
161 if (reply.isReply) {
162 for (let [filePath, metadata] of this.index) {
163 if (!metadata.isReply) {
164 if (metadata.replies.includes(replyPath)) {
165 // this is the parent
166 metadata.replies = metadata.replies.filter((p) => {
167 return p !== replyPath;
168 });
169 metadata.replies.push(filePath);
170 this.index.set(filePath, metadata);
171 this.save();
172 }
173 }
174 }
175 }
176 }
177
178 regenerateEmbeddings() {
179 pileEmbeddings.regenerateEmbeddings(this.index);

Callers

nothing calls this directly

Calls 3

saveMethod · 0.95
setMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected