theADAMJR / acrd.app

Chat app like old-style Discord, with custom themes and more.
https://acrd.app/
Mozilla Public License 2.0
246 stars 111 forks source link

[BUG] Infinitely Redirecting #33

Closed ghost closed 3 years ago

ghost commented 3 years ago

Describe the bug A portion of the index.html has a script that redirects you infinitely.

(function(l) {
  if (l.search[1] === '/' ) {
      var decoded = l.search.slice(1).split('&').map(function(s) { 
        return s.replace(/~and~/g, '&')
      }).join('?');
      window.history.replaceState(null, null, l.pathname.slice(0, -1) + decoded + l.hash
    );
  }
}(window.location))

To Reproduce Steps to reproduce the behavior:

  1. Go to 'https://accord.app'

Expected behavior A portion of the index.html has a script that redirects you infinitely.

Preview image

Additional context Remove it to fix it.

theADAMJR commented 3 years ago

Thank you. Sometimes an index.html is missing when building with create-react-app. I did get the same problem 1 or 2 days ago for a few minutes, but rebuilding it fixed it. I'm not sure what exactly causes it yet but something in GitHub actions needs to make sure index.html exists.

theADAMJR commented 3 years ago

Also, the script that causes the infinite redirects is a workaround script for using React routing with GitHub pages. Sometimes it takes a while for the website cache to update, but it's fixed for now.

theADAMJR commented 3 years ago

Added checking for index.html before deploying to GH pages for prevention. image