BokChoyWarrior opened a new pull request, #1561:
URL: https://github.com/apache/couchdb-fauxton/pull/1561

   WIP
   TODO:
   - [ ] ipv6 tests
   
   ## Overview
   
   I stumbled into lots of weird behaviour using the replication page - urls 
were being reset visually on different pages, and I was mistakenly being told I 
could not replicate a database onto itself (even though they were hosted on 
different machines!)
   
   With some digging, I found that the "isLocal" comparison was a simple 
substring search: `sourceUrl.indexOf(window.location.hostname) > -1)`
   sourceUrl is a string
   ```
   // examples
   
   > window.location.hostname
   "github.com"
   
   > "http://iamnotgithub.co.uk".indexOf(window.location.hostname)
   -1
   
   // and in my case, with my ui at myhost.co:5000 (which is additionally 
stripped of it's port when using hostname rather than host)
   > "http://public.db.myhost.com".indexOf("myhost.co")
   17 
   ```
   
   this caused the remote URLs to be displayed as the local URL and affected 
some functionality on the replicator activity page as well as the "edit 
replication" page
   
   ## Testing recommendations
   
   Open DB replicator page and experiment with the domains I listed above or 
ones you can see in the tests I added. The page and elements do not maintain 
the correct state once set.
   
   If you open a dev server, you can see instant feedback by simply checking 
out main vs this PR, the changes and bugs are created and reversed on each hot 
reload.
   
   ## Final notes
   
   Yes, I could have edited one line in a couple of places but I was enjoying 
myself 
   ## Checklist
   
   - [x] Code is written and works correctly;
   - [x] Changes are covered by tests;
   - [x] Documentation reflects the changes;
   - [ ] Update 
[rebar.config.script](https://github.com/apache/couchdb/blob/main/rebar.config.script)
 with the correct tag once a new Fauxton release is made
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to