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

Mute "ResizeObserver loop limit exceeded" exception #2032

Merged
merged 2 commits into from
Feb 9, 2022

Conversation

troelslenda
Copy link
Collaborator

Which issue does this PR close?

This PR closes #2031

What is the new behavior?

No ResizeObserver exceptions thrown in Azure App Insight when navigating to select pages

/drb/investment/securities
/drb/investment/overview
/drb/inbox

Other routes should be thoroughly tested.

Does this PR introduce a breaking change?

  • Yes
  • No

It's unclear if the changes has any sideeffects. It should be tested.

Are there any additional context?

Checklist:

The following tasks should be carried out in sequence in order to follow the process of contributing correctly.

Reminders

  • Make sure you have implemented tests following the guidelines in: "The good: Test".
  • Make sure you have updated the cookbook with examples and showcases (for bug fixes, enhancements & new components).

Review

  • Do a self-review.
  • Request that the changes are code-reviewed
  • Request that the changes are UX reviewed (only necessary if your PR introduces visual changes)

When the pull request has been approved it will be automatically merged to master via automerge.

@github-actions github-actions bot temporarily deployed to pr-resizeobserver-exception-fix February 2, 2022 15:37 Inactive
@MadsBuchmann MadsBuchmann self-requested a review February 3, 2022 11:11
@troelslenda troelslenda force-pushed the bugfix/resizeobserver-exception-fix branch from f78e857 to f46a2cf Compare February 4, 2022 08:00
@github-actions github-actions bot temporarily deployed to pr-resizeobserver-exception-fix February 4, 2022 08:07 Inactive
this.resizeObserverService.observe(this.elementRef, () => {
this.scaleHeader();
});
} catch (e) {}
Copy link
Contributor

@MadsBuchmann MadsBuchmann Feb 4, 2022

Choose a reason for hiding this comment

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

Nice!

I think we should check the message field of the exception as to not unintentionally mute other exceptions.

The standard error message is "ResizeObserver loop completed with undelivered notifications." according to the spec. According to this guy Chromium based browser might have another message set tho for some reason.

Which i believe is the one you might be seeing when testing from an Android based phone.

So we might have to check both.

So something like the below i guess 🤷

catch(e) {
   if message is either chrome message or standard message: 
      do nothing 
   else: 
      throw(e); 
} 

Copy link
Contributor

Choose a reason for hiding this comment

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

Also if this turns out to give problems or not work - let's revert to the requestAnimationFrame solution. But i think this one might be the least intrusive solution for now.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Reverted to the requestAnimationFrame due to time constraints.
The new proposed solution did not catch the error, and we need to investigate the error object a bit more to find out how to filter it. Unfortunately the process is slow, as we have to build kirby, install it in a project, and run the emulator to get feedback, so we will have to investigate more at a later time.

@troelslenda troelslenda force-pushed the bugfix/resizeobserver-exception-fix branch from f46a2cf to 44a922c Compare February 4, 2022 09:17
@MadsBuchmann MadsBuchmann changed the title Ensure that the ResizeObserver doesn't loop infinitly Mute ResizeObserver exception Feb 4, 2022
@MadsBuchmann MadsBuchmann changed the title Mute ResizeObserver exception Mute "ResizeObserver loop limit exceeded" exception Feb 4, 2022
@github-actions github-actions bot temporarily deployed to pr-resizeobserver-exception-fix February 4, 2022 09:22 Inactive
@troelslenda troelslenda force-pushed the bugfix/resizeobserver-exception-fix branch from 44a922c to 0acdca5 Compare February 4, 2022 09:47
@github-actions github-actions bot temporarily deployed to pr-resizeobserver-exception-fix February 4, 2022 09:52 Inactive
@troelslenda troelslenda force-pushed the bugfix/resizeobserver-exception-fix branch from 0acdca5 to f78e857 Compare February 4, 2022 11:03
@github-actions github-actions bot temporarily deployed to pr-resizeobserver-exception-fix February 4, 2022 11:08 Inactive
@troelslenda troelslenda force-pushed the bugfix/resizeobserver-exception-fix branch from f78e857 to ad39f2d Compare February 4, 2022 11:13
@github-actions github-actions bot temporarily deployed to pr-resizeobserver-exception-fix February 4, 2022 11:18 Inactive
@jkaltoft jkaltoft changed the base branch from main to master February 8, 2022 09:06
@jkaltoft jkaltoft force-pushed the bugfix/resizeobserver-exception-fix branch from ad39f2d to 3cb01b7 Compare February 8, 2022 09:06
@github-actions github-actions bot temporarily deployed to pr-resizeobserver-exception-fix February 8, 2022 09:11 Inactive
This is possibly less performant, according to
https://stackoverflow.com/questions/49384120/resizeobserver-loop-limit-exceeded
but seems to be the solution that is able to suppress the error in our
use case.
@RasmusKjeldgaard RasmusKjeldgaard merged commit 912e97b into master Feb 9, 2022
@RasmusKjeldgaard RasmusKjeldgaard deleted the bugfix/resizeobserver-exception-fix branch February 9, 2022 10:28
RasmusKjeldgaard added a commit that referenced this pull request Feb 10, 2022
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

Successfully merging this pull request may close these issues.

[BUG] Exception: ResizeObserver loop limit exceeded
4 participants