fix(lr-a3ca): replace double getPendingNavigate() with peekPendingNavigate() in history_meta#217
Merged
Merged
Conversation
…igate() in history_meta getPendingNavigate() clears pendingNavigate on every call. The history_meta branch called it twice: the first call returned the nav object and nulled it; the second returned null and threw TypeError on .toolId access. The nav was also consumed before history_done could use it, so the "Go to chat" scroll never fired. Add peekPendingNavigate() to filebrowser.js that reads pendingNavigate without clearing it. Replace the triple getPendingNavigate() calls in the history_meta condition with a single peekPendingNavigate() into a local. The consuming getPendingNavigate() in history_done is unchanged and remains the sole consumer. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ontract Verifies that peekPendingNavigate() is non-consuming (called twice returns the same object) and that getPendingNavigate() consumes exactly once. The regression test explicitly exercises the pre-fix buggy path (three getPendingNavigate() calls in history_meta) and asserts it leaves history_done with null — proving the peek-only fix is load-bearing. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…dd regression tests filebrowser.js imported three functions from a new DOM-free module (lib/public/modules/pending-navigate.js) instead of holding inline implementations. This makes the peek/consume contract testable in Node without a DOM shim. test/pending-navigate.test.js imports the real module and covers: - peekPendingNavigate is non-consuming (two peeks return the same object) - getPendingNavigate is consuming (second call returns null) - Nav survives history_meta (peek path) and is consumed by history_done - Regression: consuming get in history_meta clears nav before history_done Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…orts real ESM module) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
This issue has been resolved in version 1.5.0-beta.1 (beta). To update, run: |
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.
No description provided.