Skip to content

docs: improve API rate-limit error handling in table-http-example #22776

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

Merged

Conversation

devversion
Copy link
Member

There are currently three issues with the table-http-example:

  1. If a user hits the rate limit within this example, an overlay
    will be displayed mentioning the rate limit issue. This overlay
    intends to overlap the whole table, except for the paginator. Right
    now this is broken as there is a minium height throwing off the
    assumption that the paginator is at the bottom of the example.

  2. If a user hits the rate limit, the paginator length is reset to
    zero. This means that the user is unable to trigger new requests
    as the previous/next page buttons become disabled.

  3. Due to incorrect error handling, the observable will be
    replaced by a new one that will always return an empty list.
    The rate limit/API errors should be caught within the switch
    map to not prevent future API requests on errors.

Updated StackBlitz: https://stackblitz.com/edit/angular-vf4jjs?file=src/app/table-http-example.ts

Fixes #11547.

There are currently three issues with the `table-http-example`:

1. If a user hits the rate limit within this example, an overlay
will be displayed mentioning the rate limit issue. This overlay
intends to overlap the whole table, except for the paginator. Right
now this is broken as there is a minium height throwing off the
assumption that the paginator is at the bottom of the example.

2. If a user hits the rate limit, the paginator length is reset to
zero. This means that the user is unable to trigger new requests
as the previous/next page buttons become disabled.

3. Due to incorrect error handling, the observable will be
replaced by a new one that will always return an empty list.
The rate limit/API errors should be caught within the switch
map to not prevent future API requests on errors.

Fixes angular#11547.
@devversion devversion added merge safe target: patch This PR is targeted for the next patch release labels May 24, 2021
@devversion devversion requested a review from andrewseguin May 24, 2021 18:06
@google-cla google-cla bot added the cla: yes PR author has agreed to Google's Contributor License Agreement label May 24, 2021
@andrewseguin andrewseguin added the action: merge The PR is ready for merge by the caretaker label May 24, 2021
@wagnermaciel wagnermaciel merged commit e6ba4c6 into angular:master May 25, 2021
wagnermaciel pushed a commit that referenced this pull request May 25, 2021
…2776)

There are currently three issues with the `table-http-example`:

1. If a user hits the rate limit within this example, an overlay
will be displayed mentioning the rate limit issue. This overlay
intends to overlap the whole table, except for the paginator. Right
now this is broken as there is a minium height throwing off the
assumption that the paginator is at the bottom of the example.

2. If a user hits the rate limit, the paginator length is reset to
zero. This means that the user is unable to trigger new requests
as the previous/next page buttons become disabled.

3. Due to incorrect error handling, the observable will be
replaced by a new one that will always return an empty list.
The rate limit/API errors should be caught within the switch
map to not prevent future API requests on errors.

Fixes #11547.

(cherry picked from commit e6ba4c6)
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Jun 25, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[doc] Data table HTTP example is evil
3 participants