fix: Redis expire guard, transferOwnership prev-owner, SVG regex
- Redis get() rejects legacy expire=0 entries and cleans them up - transferOwnership invalidates previous owner in addition to new - SVG regex uses non-greedy match and handles self-closing <svg /> - SVG fallback returns empty string instead of HTML wrapper - Memory channel comment: FIFO eviction, not timestamp-based
This commit is contained in:
4 files changed
+17
-3
No files matched your search
@@ -12,7 +12,7 @@ export const memoryPublish = (channel: string, data: unknown) => {
|
||||
const serialized = superjson.stringify(data);
|
||||
lastData.set(channel, { data: serialized, timestamp: Date.now() });
|
||||
|
||||
// Bounded: evict oldest if over limit
|
||||
// ponytail: FIFO eviction by Map insertion order, not timestamp.
|
||||
if (lastData.size > MAX_ENTRIES) {
|
||||
const oldest = lastData.keys().next().value;
|
||||
if (oldest) lastData.delete(oldest);
|
||||
|
||||
Reference in new issue
Block a user