Fix Quadratic Polling#111
Merged
Merged
Conversation
- Implemented session-specific message retention in history handling. - Added functionality to dispose of detached message nodes and overlays. - Improved incremental scanning of message nodes for better performance. - Updated remote config synchronization to prevent unnecessary storage writes. - Enhanced tests for remote config and storage change events.
- Implement centralized message host ownership in host.js - Refactor history message handling to enforce current session constraints - Improve load history functionality with session-specific caching - Update message processing to clean up associated hosts and improve context handling - Enhance scanner functionality for better message processing and state management - Normalize remote config handling for improved storage hygiene - Add comprehensive tests for scanner scheduling and message processing
…e checks, and improved message handling
- Implement async flow tests for load-all-history, covering scenarios such as request dispatching, loading states, and response handling. - Enhance scanner tests to ensure proper behavior with #bds-root isolation, including message processing and timer management. - Introduce new tests for storage mock contracts to validate storage interactions and event emissions. - Create a new test suite for host wrapper functionality, ensuring correct wrapper creation, host management, and message reparenting behavior.
- Update CI configuration to use the correct Firefox binary path. - Implement deep equality check for remote config comparison to avoid unnecessary writes. - Refactor message scanning logic to ensure only valid nodes trigger scans. - Improve wrapper management for message nodes during reparenting. - Add fixtures for remote config and status in tests. - Enhance tests for storage stability and message handling across sessions.
…dicated functions and implementing deep equality checks for config updates
- Updated `setupBridgeEvents` to return a cleanup function that removes all registered listeners, allowing for fresh setups. - Consolidated event handler registration into a single object for better management and cleanup. - Enhanced error handling and logging for network state and session data events. Enhance remote config persistence with structured error handling - Replaced structural equality checks with a deep equality function for more accurate change detection in `RemoteConfigManager`. - Improved error handling in `persistRemoteConfig`, `persistRemoteStatus`, and `persistLocales` to return detailed error messages. - Consolidated storage updates to minimize writes and ensure atomic updates for config and metadata. Refactor host wrapper management for better DOM handling - Improved `getOrCreateWrapper` to handle detached messages more effectively, ensuring wrappers are removed from the DOM when messages are detached. - Added tests to verify the behavior of wrapper detachment and reconnection. Update integration tests for persistence and host management - Enhanced tests for `persistRemoteConfig`, `persistRemoteStatus`, and `persistLocales` to cover new error handling and atomic updates. - Added tests for host wrapper behavior during detachment and reconnection scenarios.
…le validation - Added checks to ensure download cards are correctly nested within wrappers in e2e tests. - Refactored fixture request handling in e2e tests to use a shared resolver for improved maintainability. - Introduced lifecycle tests for setupBridgeEvents to validate cleanup and listener behavior. - Enhanced scanner tests to ensure only new messages are processed during transitions. - Expanded storage mock contracts to cover various scenarios including reset behavior and listener independence. - Implemented deepEqual tests to validate object and array equality, including nested structures and key reordering.
- Introduced functions to manage known nodes more effectively, including rebuilding known nodes, updating indexes, and removing nodes. - Improved the registration process for known nodes to ensure accurate tracking of the latest assistant message. - Refactored the scanPage function to utilize the new known node management system, enhancing performance and reliability. feat(storage): improve storage change listener management - Refactored the storage change listener to ensure idempotency and proper cleanup. - Added a mechanism to handle listener registration and cleanup more effectively, preventing stale references. feat(remote-config): update remote config methods for async handling - Modified applyRemote, replaceRemote, and resetToBuiltin methods to return promises, ensuring proper handling of asynchronous storage operations. - Enhanced error handling during persistence operations to provide better feedback on failures. test(e2e): enhance Firefox extension tests with improved stability checks - Added functionality to wait for storage quiet periods to ensure accurate event counting. - Improved event listener management in tests to prevent memory leaks and ensure proper cleanup. test(integration): add tests for fixture resolver and storage listener lifecycle - Implemented tests for the fixture resolver to ensure proper handling of external URLs and locale codes. - Added tests for the storage listener lifecycle to verify idempotency and cleanup behavior.
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.
PR fixes the root causes of the performance degradation in #105 and repeated storage activity in #108 across the Chrome-target build and Firefox.
Message scanning and pricing performance (#105)
indexOflookups with an ordered message registry backed by weak-map indexes.Remote persistence and storage stability (#108)
fetchthrough a bound adapter.messagesvalues.Browser test infrastructure
Playwright runs the exact production
dist-chromebuild in bundled Chromium. Current branded Chrome releases cannot side-load unpacked extensions through Playwright, so store-installed branded-Chrome verification remains a manual release check: https://playwright.dev/docs/chrome-extensionsTesting
npm testnpm run test:androidgit diff --checkCloses #105
Closes #108