Skip to content
This repository has been archived by the owner on Apr 11, 2022. It is now read-only.

Fix search bugs, various 404s, performance improvements #201

Merged
merged 26 commits into from
Jan 29, 2020

Conversation

zone117x
Copy link
Contributor

@zone117x zone117x commented Jan 24, 2020

Goal

This PR intended to fix bugs related to searching, and various instances of page loading timeouts or Not found errors. The primary problems were:

  1. Some pages performing many queries to various services, and/or queries that have become extremely slow with ~2 million name records.
  2. Bugs in the front-end next.js routing paths.

Nearly all pages now have non-cached sub-second load times. Some take a few seconds, but less than the >1 minute / error durations. Notably, name pages and the home page consistently take a few seconds when not cached.

Note: Some pages will occasionally take ~15 seconds to load when both A) the cache expired and B) the core node ProgressDB is performing a bulk data import cycle. Additionally, some pages can show errors when one of the core node API endpoints returns internal server errors. A follow-up PR will alleviate both of these conditions.

Bug fixes

Several other bugs were fixed in the process of debugging and tackling these issues. I went through the backlog and the following issue should now be closed:

Note for reviewers

Most of the changes are in the explorer API repo, see associated PR: stacks-archive/blockstack-explorer-api#32

Changes to this repo (the front-end) include:

  • <Link> pathname fixes.
  • Refactoring the search feature.
  • Changes for parsing & displaying new API data formats.
  • Upgraded next.js from v8 to v9. Thank you @aulneau for the help!

These PRs also include the changeset from the remove blockchain.info API front-end and API PRs. Those could not be easily tested due to bugs in staging and next.js routing.

Testing

Both the front-end and API changes are live on staging: https://explorer.staging.blockstack.xyz

* master:
  Update home page stats formatting.
  hotfix for normalizing prometheus paths
* Several updates for changes to the API output data.
* Fix floating-point errors with bitcoin value displays.
* Fixed slow and buggy search functionality.
* Moved search logic off of the client - fixed bug when js is disabled and improved search result speed.
@zone117x
Copy link
Contributor Author

Tagging @aulneau to help review the front-end next.js related changes

@@ -75,7 +75,7 @@ const ListItemComponent = sys(

const Item = ({ href, as, ...rest }) =>
href ? (
<Link href={href} passHref as={as}>
<Link href={href} passHref as={as} prefetch={false}>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call to not prefetch too many things. FYI, if you upgrade to next.js 9 (which is a good upgrade), they automatically prefetch all links that are visible unless you explicitly say not to (as here).

Copy link
Collaborator

@yknl yknl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great to me, thanks for this @zone117x

@timstackblock
Copy link
Collaborator

timstackblock commented Jan 29, 2020

@zone117x This PR is a lot faster and works well performance wise.

All issues are resolved except for the following

#190
#204
#203

@zone117x zone117x merged commit 8daa384 into master Jan 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants