MCPcopy Create free account
hub / github.com/DeepNotesApp/DeepNotes / _handleHSet

Method _handleHSet

apps/realtime-server/src/sockets.ts:318–340  ·  view source on GitHub ↗
(args: [DataPrefix, string, string, any])

Source from the content-addressed store, hash-verified

316 }
317
318 private async _handleHSet(args: [DataPrefix, string, string, any]) {
319 const [prefix, suffix, field] = args;
320
321 if (
322 !(await (dataHashes[prefix] as DataHash)?.fields[field]?.userSettable?.({
323 dataAbstraction: dataAbstraction(),
324 userId: this.userId,
325 suffix,
326 }))
327 ) {
328 return;
329 }
330
331 const resolvable = new Resolvable();
332
333 this._hSetBuffer.push([...args, resolvable]);
334
335 if (this._hSetBuffer.length === 1) {
336 setTimeout(() => this._flushHSetBuffer());
337 }
338
339 return await resolvable;
340 }
341 private async _flushHSetBuffer() {
342 if (this._hSetBuffer.length === 0) {
343 return;

Callers 1

_handleCommandMethod · 0.95

Calls 1

_flushHSetBufferMethod · 0.95

Tested by

no test coverage detected