Repository navigation
fix(graph): a reload after creating a graph opens the new graph - #13624
Merged
Merged
Conversation
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Oct 6, 2026
tiensonqin
approved these changes
Oct 7, 2026
At start the window opens the graph its tab remembers before the last current graph; creating a graph never updated the tab, so a reload reopened the graph opened before it (db-test logseq#1361). create-db now registers the new graph and remembers it in the tab, as a switch does.
tiensonqin
force-pushed
the
fix/new-graph-tab-memory
branch
from
October 7, 2026 11:27
baa92fe to
18493c6
Compare
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Oct 8, 2026
devin-ai-integration Bot
pushed a commit
that referenced
this pull request
Oct 8, 2026
At start the window opens the graph its tab remembers before the last current graph; creating a graph never updated the tab, so a reload reopened the graph opened before it (db-test #1361). create-db now registers the new graph and remembers it in the tab, as a switch does.
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Oct 11, 2026
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Oct 11, 2026
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Oct 13, 2026
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Oct 13, 2026
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Oct 16, 2026
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Oct 16, 2026
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.
Fixes logseq/db-test#1361.
Create a DB graph A, reload, create a second graph B, reload: A opens, not B. On the desktop app the window also keeps B's route, so it shows "Page not found" in A.
At start the window picks its graph from the URL, then the graph the tab remembers (
sessionStorage,graph-tab/get-tab-repo), then:git/current-repo. Creating a graph sets:git/current-repo, but the tab's entry is written only at start (restore-and-setup!) and by a switch through the graph list (graph-switch-on-persisted, which calls<upsert-current-graph-registry!andremember-current-graph-id-in-tab!). After the first reload the tab remembers A, creating B does not replace it, and the next reload resolves to A.create-dbinsrc/main/frontend/handler/repo.cljsnow does what a switch does once the new graph is set up: it adds the graph to the registry and remembers it in the tab. A file-graph import is left as it was; its own flow decides which graph the tab ends on.create-db-does-not-start-renderer-db-conn-testinsrc/test/frontend/handler/repo_test.cljsnow also checks that a new graph is remembered in the tab and registered, and that an import does neither. On master the new checks fail; with the change they pass.frontend.handler.repo-test,frontend.handler.graph-test,frontend.handler.events-testandfrontend.components.repo-testpass.