Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HydroShare Export Handle Timeout #2616

Merged
merged 2 commits into from
Jan 23, 2018
Merged

Conversation

rajadain
Copy link
Member

Overview

Prevents front-end crash from HydroShare export timeouts. Also shortens re-export time by skipping pre-exported analyses.

Connects #2615

Testing Instructions

  • On develop, export a MapShed project to HydroShare. Then add a scenario / make a change. Observe the network tab and the console, and see the timeout and JavaScript error.
  • Check out this branch, but only the first commit 532c660. Update your project and see the timeout now being handled in the front-end.
  • Now checkout the second commit 0b54dc1. Update your project and see no timeout.

Previously a timeout would cause an exception, breaking
the flow of JavaScript on the front-end. By checking if
result.responseJSON exists before calling it, we ensure
that this doesn't happen.

Furthermore, if we get a 504 response, we use a specific
error message to communicate the timeout.
Previously we would always export all files coming from
the front-end. However, this is really slow and leads to
frequent timeouts on the front-end. To alleviate this,
we check if the analyze files have been exported already.
If so, we exclude them.

This allows for the possibility of a partial analyze export
(say, if the streams tab was still loading while exporting)
to be completed at a later time if it becomes available, but
any existing analyses are unlikely to have changed, since
they depend only on the area of interest (and app config).
Copy link

@arottersman arottersman left a comment

Choose a reason for hiding this comment

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

+1, tested both commits. Error is handled much more gracefully, and timeouts no longer occur when we are more selective about which files we push.

@arottersman arottersman assigned rajadain and unassigned arottersman Jan 23, 2018
@rajadain
Copy link
Member Author

Thanks for the quick review! Merging now.

@rajadain rajadain merged commit 039740c into develop Jan 23, 2018
@rajadain rajadain deleted the tt/hydroshare-export-handle-timeout branch January 23, 2018 17:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants