couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject fauxton commit: updated refs/heads/master to 9255805
Date Mon, 22 Jun 2015 18:04:31 GMT
Repository: couchdb-fauxton
Updated Branches:
  refs/heads/master 20d1e0c37 -> 9255805ff

Fix for relative link handling issue in test environment

There's an issue with our current beta where clicking on a View
name in the new React sidebar doesn't redirect the user to that
view, but just shrinks the view section.

Michelle got a fix in place in this PR: It works
fine, but I didn't want to have to cancel events any time this

After some digging, we found that this issue only occurs on environments. It works fine
locally, and wouldn't occur on prod. But it's a Fauxton issue.

The issue is that the modified line of code in this PR was
determining whether a link should be handled via the backbone
router by comparing the base of the URL, including the folder. That would always fail
to be true on beta environments because no link linked to the
dashboard.assets folder.

So remarkably, the navigate() line wasn’t running at all for
any link on the environments, but links still
worked because the router independently listened to the hash
changes and handled the routing. The only difference was that
the event wasn’t canceled, which caused the issue described above.

I think the change made in this PR is safe. The purpose of the
line is to determine "relative" links (or rather links within
Fauxton), so I just made it a little more generic by comparing
the http://whatever:port/ part, and not
http://whatever:port/subfolder/ part.

Michelle mentioned there have been other instances where we
seem to need to cancel events like this. This should solve that.

Hope this is clear.


Branch: refs/heads/master
Commit: 9255805ff8f36a02edf7b2122df27fd727e9c75f
Parents: 20d1e0c
Author: Ben Keen <>
Authored: Thu Jun 18 10:24:07 2015 -0700
Committer: Ben Keen <>
Committed: Mon Jun 22 11:04:12 2015 -0700

 app/main.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/main.js b/app/main.js
index d5d903c..15c585c 100644
--- a/app/main.js
+++ b/app/main.js
@@ -34,8 +34,8 @@ function (app, FauxtonAPI, LoadAddons) {
     // Get the absolute anchor href.
     var href = { prop: $(this).prop("href"), attr: $(this).attr("href") };
-    // Get the absolute root.
-    var root = location.protocol + "//" + + app.root;
+    // Get the absolute root
+    var root = location.protocol + "//" +;
     // Ensure the root is part of the anchor href, meaning it's relative
     if (href.prop && href.prop.slice(0, root.length) === root) {

View raw message