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

Interceptor buffers same request multiple times #9

Closed
mzvonar opened this issue Mar 1, 2013 · 2 comments
Closed

Interceptor buffers same request multiple times #9

mzvonar opened this issue Mar 1, 2013 · 2 comments

Comments

@mzvonar
Copy link

mzvonar commented Mar 1, 2013

When same unauthenticated url is requested multiple times, interceptors stores this url multiple times.

This could be solved by changing the buffer to associative array as save request with url as key and then using for-in loop in retryAll() function. So if same url request is already in buffer it gets replaced with new request.

I'm not very experienced in JavaScript, nor AngularJS. So maybe this is not a good idea for some reason. But I can't see any problem so far. What do you think?

@witoldsz
Copy link
Owner

witoldsz commented Mar 1, 2013

The URL can be same, but content can change. Also, there is a question: what to do with old requests replaced by new ones? Each request has some callback chain (functions attached to promises). Should we reject the promises of those requests?

This is why I have decided to store and eventually retry every request.

@mzvonar
Copy link
Author

mzvonar commented Mar 1, 2013

oh, ok. thanks for explaining

@mzvonar mzvonar closed this as completed Mar 1, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants