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

Better handling for lots of parallel network requests and a bad network #5

Open
NerdyTherapist opened this issue May 14, 2017 · 1 comment

Comments

@NerdyTherapist
Copy link
Member

When the user is in a bad network environment (unreliable EDGE, for example) and/or sets off lots of requests by a lot of scrolling around (since requests take so long), the app handles it very poorly. A request timeout is now being logged in console and no longer crashes the app now, but the user is not being informed at all.

Optimal fix: Show a notification, that there are network problems, maybe even the localized error description.
Also: Is there a way to cancel pending network activity when a new request is being made? That would be quite nice for server load and app activity.

@mguentner
Copy link
Member

mguentner commented May 15, 2017

In the Angular 1 Frontend, a lot of requests are saved by loading more than what is currently visible, assuming that most users will just pan around their current location.
Here's the code:

https://github.com/MateMonkey/frontend/blob/master/app/js/application.js#L148

and here the corresponding function that checks whether the current bounds (the view) are larger anywhere outside the previously fetched bounds rectangle:

https://github.com/MateMonkey/frontend/blob/04f775d2db4ecf89d6ab6ce1f820ea23f9484e97/app/js/map.js#L80

Using that you can pan / explore a bit until you need to load a whole new rectangle.
That is a good trade-off solution between a stitched-together multi-polygon (each request would append / add to that polygon), therefore managing a complex local state and requesting after each view change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants