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

Method _handleHGet

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

Source from the content-addressed store, hash-verified

243 }
244
245 private async _handleHGet(args: [DataPrefix, string, string]) {
246 const [prefix, suffix, field] = args;
247
248 // Check if user can access value
249
250 if (
251 !(dataHashes[prefix] as DataHash)?.fields[field]?.userGettable?.({
252 dataAbstraction: dataAbstraction(),
253 userId: this.userId,
254 suffix,
255 })
256 ) {
257 return;
258 }
259
260 const resolvable = new Resolvable<any>();
261
262 this._hGetBuffer.push([...args, resolvable]);
263
264 if (this._hGetBuffer.length === 1) {
265 setTimeout(() => this._flushHGetBuffer());
266 }
267
268 return await resolvable;
269 }
270 private async _flushHGetBuffer() {
271 if (this._hGetBuffer.length === 0) {
272 return;

Callers 1

_handleCommandMethod · 0.95

Calls 1

_flushHGetBufferMethod · 0.95

Tested by

no test coverage detected