Skip to content

TypeError in filter when disconnecting during update #9240

@nwhittaker

Description

@nwhittaker

Check existing issues

Actual Behavior

If a <calcite-filter> element is in the middle of its update lifecycle when it's disconnected, it throws a TypeError.

Expected Behavior

If a <calcite-filter> element is in the middle of its update lifecycle when it's disconnected, it does not throw a TypeError.

Reproduction Sample

https://codepen.io/nwhittaker-esri/pen/LYvMQMm

Reproduction Steps

  1. Visit the code sample and open the dev tool's console
  2. See the TypeError logged in the console

Reproduction Version

2.7.1

Relevant Info

Looking at the stack trace, it appears as though the filter's update render is setting messageOverrides on its <calcite-input> element which in turn attempts to call the input's onMessagesChange watch method which is undefined at that point due to the input having been disconnected.

TypeError: f[t] is not a function
    at index.js:2464:38
    at Array.map (<anonymous>)
    at yt (index.js:2461:34)
    at f.set [as messageOverrides] (index.js:2557:25)
    at _ (index.js:926:29)
    at K (index.js:999:9)
    at nt (index.js:1577:17)
    at Z (index.js:1356:13)
    at nt (index.js:1583:13)
    at Z (index.js:1356:13)

This issue may not be limited to the filter component. It may impact any component that, in their render() methods, set messageOverrides on another component.

Regression?

No response

Priority impact

p3 - want for upcoming milestone

Impact

Adds verbosity to console logs and can be a red herring when debugging other issues. Can also impact how layouts are designed to mitigate the presence of this error.

Calcite package

  • @esri/calcite-components
  • @esri/calcite-components-angular
  • @esri/calcite-components-react
  • @esri/calcite-design-tokens
  • @esri/eslint-plugin-calcite-components

Esri team

ArcGIS Field Apps

Metadata

Metadata

Labels

4 - verifiedIssues that have been tested, confirmed as mitigated, and are ready to close.ArcGIS Field AppsIssues logged by ArcGIS Field Apps team members.bugBug reports for broken functionality. Issues should include a reproduction of the bug.calcite-componentsIssues specific to the @esri/calcite-components package.estimate - 3A day or two of work, likely requires updates to tests.impact - p2 - want for an upcoming milestoneUser set priority impact status of p2 - want for an upcoming milestonep - lowIssue is non core or affecting less that 10% of people using the library

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions