• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

zeit / next.js / 9067
52%

Build:
DEFAULT BRANCH: master
Ran 11 Jan 2019 05:42PM UTC
Jobs 1
Files 85
Run time 18s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
9067

push

travis-ci

timneutkens
should not change method to replaceState unless asPath is the same (#6033)

original code in `/lib/router/router.js`
```
  urlIsNew (pathname, query) {
    return this.pathname !== pathname || !shallowEquals(query, this.query)
  }
```
the urlIsNew compare `this.pathname` to an argument `pathname`
the invokers:
```
    // If asked to change the current URL we should reload the current page
    // (not location.reload() but reload getInitialProps and other Next.js stuffs)
    // We also need to set the method = replaceState always
    // as this should not go into the history (That's how browsers work)
    if (!this.urlIsNew(asPathname, asQuery)) {
      method = 'replaceState'
    }
```
the parameter here is `asPathname` destructured from `asPath`

so here is a problem when we reuse a single page rendered in two asPaths

pages/a.js
```
<>
  <Link href='/a'><a>goto a</a></Link>
  <Link href='/a' as='/b'><a>goto b</a></Link>
</>
```
If we navigate to page /a, then click 'goto b', actually the history is replaced, not pushed.
It is expected that history could be correctly pushed and popped as long as the browser url is changed.

760 of 2092 branches covered (36.33%)

3462 of 4202 relevant lines covered (82.39%)

5.04 hits per line

Jobs
ID Job ID Ran Files Coverage
1 9067.1 11 Jan 2019 05:42PM UTC 0
82.39
Travis Job 9067.1
Source Files on build 9067
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #9067
  • ab46c451 on github
  • Prev Build on master (#8840)
  • Next Build on master (#9427)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc