Bug Fixed: Problems with builds list pagination in Safari browser

There was a reported problem with pagination links on the page that lists team builds status in the Safari browser on macOS. It’s now fixed.

The problem

The list of team builds is broken up into pages of 15 items, with pagination links (<< 1 2 3 4 5 >> etc) to make it easy to jump around the list. In Safari, clicking on page 2 would cause the pagination to display as it it were on page 14, which was unhelpful.

The solution

Warning: nerdiness lies ahead!

The pagination updates its state rather elegantly from HTML metadata in the page. (I didn’t write it, but I thought it was a neat solution.) Part of this involves parsing a “next page” URL query string to retrieve two values; the current page and the number of items to show per_page. This is done with a very simple regular expression.

Somewhere along the chain in Safari, either the data is mutated differently, or the regex engine parses differently, but the regex was matching the per_page parameter and interpreting it as page. Therefore the next page was read as 15 (the per_page value) and the current page was set as 14.

We made the regex slightly stricter and solved the problem. :nerd_face:

Thank you to those in the community who reported it so descriptively. A clear report makes problems so much easier for us to find and fix.

3 Likes