From b80f7e01e9065f88dcbb2feec6e4c7be8c54d7c9 Mon Sep 17 00:00:00 2001 From: naielv <109038805+naielv@users.noreply.github.com> Date: Wed, 18 Jun 2025 11:33:42 +0200 Subject: [PATCH] Fix localStorage Max --- static/gun.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/static/gun.js b/static/gun.js index 7493bc0..62db223 100644 --- a/static/gun.js +++ b/static/gun.js @@ -1825,9 +1825,10 @@ }); root.on('put', function(msg){ - var put = msg.put, soul = put['#'], key = put['.'], id = msg['#'], ok = msg.ok||'', tmp; // pull data off wire envelope - if (!(root.next || '')[soul]) return; this.to.next(msg); // remember to call next middleware adapter + var put = msg.put, soul = put['#'], key = put['.'], id = msg['#'], ok = msg.ok||'', tmp; // pull data off wire envelope + if (!(soul.startsWith(TABLE))) return; // fix https://github.com/amark/gun/issues/1377 + console.warn(TABLE, soul) disk[soul] = Gun.state.ify(disk[soul], key, put['>'], put[':'], soul); // merge into disk object if(stop && size > (4999880)){ root.on('in', {'@': id, err: "localStorage max!"}); return; } //if(!msg['@']){ acks.push(id) } // then ack any non-ack write. // TODO: use batch id.