[Node] fix /app/octobots browser memory leak - #3653
Open
Herklos wants to merge 1 commit into
Open
Conversation
openDB() in device-key.ts never closed its IDBDatabase, and OpenAPI.PASSWORD is resolved on every API request, so each call leaked two open connections (one in idbLoadRecord, one in getOrCreateDeviceKey). On /app/octobots, which polled GET /tasks every 2s, that was roughly 3600 leaked connections per hour. - device-key.ts: memoise one connection per tab, reset on onclose/onversionchange. Cache the device CryptoKey and the decrypted password in memory; clearPassword() drops the cache first so clearAuth() and the 401 interceptor still invalidate. - task-queries.ts: poll at 5s, stop polling in hidden tabs. - BotCard.tsx: replace the per-poll JSON.stringify comparison with a reference fast path plus a field-by-field execution compare. - GET /tasks: add include_content (default false). Task.content is a verbatim copy of the active execution's actions, already present in executions, and read nowhere in the UI. Ownership checks pass include_content=False. - workflows_util: stray print on every unparseable workflow row to logger.debug. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Try to fix #3647