[COMPASS-6809] calculateSchemaDepth() for schema telemetry tracking can fail with max call stack size Created: 10/May/23  Updated: 29/Oct/23  Resolved: 22/May/23

Status: Closed
Project: Compass
Component/s: Schema, Telemetry Data
Affects Version/s: 1.36.4
Fix Version/s: 1.37.0

Type: Bug Priority: Minor - P4
Reporter: Anna Henningsen Assignee: Rhys Howell
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

See HELP-45308


Issue Links:
Depends
Related
Story Points: 2
Documentation Changes: Not Needed
Sprint: Iteration Brontosaurus

 Description   

See HELP-45308. In particular, the log file reveals:

RangeError: Maximum call stack size exceeded
    at h.calculateSchemaDepth (file:///.../Contents/Resources/app.asar/build/index-4d5b3902.296b00060d11308fb943.renderer.js:199:5797)
    at h._trackSchemaAnalyzed (file:///.../Contents/Resources/app.asar/build/index-4d5b3902.296b00060d11308fb943.renderer.js:199:6238)
    at h.startAnalysis (file:///.../Contents/Resources/app.asar/build/index-4d5b3902.296b00060d11308fb943.renderer.js:199:7520)
    at process.processTicksAndRejections (node:internal/process/task_queues:96:5)



 Comments   
Comment by Githook User [ 30/May/23 ]

Author:

{'name': 'Rhys', 'email': 'Anemy@users.noreply.github.com', 'username': 'Anemy'}

Message: chore(import-export, schema, field-store): update mongodb-schema, use schema paths helper COMPASS-6720 (#4401)

This updates our mongodb-schema dependency in Compass.

Updating to the new version involves a few changes:

  • Schema field paths now use string arrays instead of dot separated strings. This will make it easier for us to handle cases like dots in field names (previously we would join and split on dots).
  • Better schema type definitions are now exported from mongodb-schema. This involved some changes in compass-schema and compass-import-export as we were supporting our own types.
  • Removed the getSchemaPaths function from compass-import-export and updated to use the one from the mongodb-schema package,.
  • Removed the unused dimensionality and nestedFields properties and calculations in compass-field-store. (could be separated to another pr if preferred).
  • In compass-field-store renamed the aceFields flattened map used for editor field autocompletion to autocompleteFields to be more generic as we are using this in code-mirror and no longer have ace. (could be separated to another pr if preferred).
  • Updated schema property variable names, has_duplicates, average_length, and total_count, are now camelCase.
    When integrating changes in compass-schema there were updates needed in the telemetry methods, schemaContainsGeoData and calculateSchemaDepth. I ended up refactoring both and hopefully simplifying calculateSchemaDepth a bit, it looks like it might fix a recent error we had. Moved them off the store. Updated tests to be easier to maintain. We could consider moving the calculateSchemaDepth into mongodb-schema, but that's not included in these changes. I'm thinking this should fix COMPASS-6809
    Branch: redux-typescript-query-history-store
    https://github.com/mongodb-js/compass/commit/1f2d29fb2e9529fa6fa8d80f28567a7216fbf975
Comment by Githook User [ 25/May/23 ]

Author:

{'name': 'Rhys', 'email': 'Anemy@users.noreply.github.com', 'username': 'Anemy'}

Message: chore(import-export, schema, field-store): update mongodb-schema, use schema paths helper COMPASS-6720 (#4401)

This updates our mongodb-schema dependency in Compass.

Updating to the new version involves a few changes:

  • Schema field paths now use string arrays instead of dot separated strings. This will make it easier for us to handle cases like dots in field names (previously we would join and split on dots).
  • Better schema type definitions are now exported from mongodb-schema. This involved some changes in compass-schema and compass-import-export as we were supporting our own types.
  • Removed the getSchemaPaths function from compass-import-export and updated to use the one from the mongodb-schema package,.
  • Removed the unused dimensionality and nestedFields properties and calculations in compass-field-store. (could be separated to another pr if preferred).
  • In compass-field-store renamed the aceFields flattened map used for editor field autocompletion to autocompleteFields to be more generic as we are using this in code-mirror and no longer have ace. (could be separated to another pr if preferred).
  • Updated schema property variable names, has_duplicates, average_length, and total_count, are now camelCase.
    When integrating changes in compass-schema there were updates needed in the telemetry methods, schemaContainsGeoData and calculateSchemaDepth. I ended up refactoring both and hopefully simplifying calculateSchemaDepth a bit, it looks like it might fix a recent error we had. Moved them off the store. Updated tests to be easier to maintain. We could consider moving the calculateSchemaDepth into mongodb-schema, but that's not included in these changes. I'm thinking this should fix COMPASS-6809
    Branch: COMPASS-6740-scroll-to-a-card
    https://github.com/mongodb-js/compass/commit/1f2d29fb2e9529fa6fa8d80f28567a7216fbf975
Comment by Githook User [ 24/May/23 ]

Author:

{'name': 'Rhys', 'email': 'Anemy@users.noreply.github.com', 'username': 'Anemy'}

Message: chore(import-export, schema, field-store): update mongodb-schema, use schema paths helper COMPASS-6720 (#4401)

This updates our mongodb-schema dependency in Compass.

Updating to the new version involves a few changes:

  • Schema field paths now use string arrays instead of dot separated strings. This will make it easier for us to handle cases like dots in field names (previously we would join and split on dots).
  • Better schema type definitions are now exported from mongodb-schema. This involved some changes in compass-schema and compass-import-export as we were supporting our own types.
  • Removed the getSchemaPaths function from compass-import-export and updated to use the one from the mongodb-schema package,.
  • Removed the unused dimensionality and nestedFields properties and calculations in compass-field-store. (could be separated to another pr if preferred).
  • In compass-field-store renamed the aceFields flattened map used for editor field autocompletion to autocompleteFields to be more generic as we are using this in code-mirror and no longer have ace. (could be separated to another pr if preferred).
  • Updated schema property variable names, has_duplicates, average_length, and total_count, are now camelCase.
    When integrating changes in compass-schema there were updates needed in the telemetry methods, schemaContainsGeoData and calculateSchemaDepth. I ended up refactoring both and hopefully simplifying calculateSchemaDepth a bit, it looks like it might fix a recent error we had. Moved them off the store. Updated tests to be easier to maintain. We could consider moving the calculateSchemaDepth into mongodb-schema, but that's not included in these changes. I'm thinking this should fix COMPASS-6809
    Branch: COMPASS-6593-add-performance-tab-indicator
    https://github.com/mongodb-js/compass/commit/1f2d29fb2e9529fa6fa8d80f28567a7216fbf975
Comment by Githook User [ 23/May/23 ]

Author:

{'name': 'Rhys', 'email': 'Anemy@users.noreply.github.com', 'username': 'Anemy'}

Message: chore(import-export, schema, field-store): update mongodb-schema, use schema paths helper COMPASS-6720 (#4401)

This updates our mongodb-schema dependency in Compass.

Updating to the new version involves a few changes:

  • Schema field paths now use string arrays instead of dot separated strings. This will make it easier for us to handle cases like dots in field names (previously we would join and split on dots).
  • Better schema type definitions are now exported from mongodb-schema. This involved some changes in compass-schema and compass-import-export as we were supporting our own types.
  • Removed the getSchemaPaths function from compass-import-export and updated to use the one from the mongodb-schema package,.
  • Removed the unused dimensionality and nestedFields properties and calculations in compass-field-store. (could be separated to another pr if preferred).
  • In compass-field-store renamed the aceFields flattened map used for editor field autocompletion to autocompleteFields to be more generic as we are using this in code-mirror and no longer have ace. (could be separated to another pr if preferred).
  • Updated schema property variable names, has_duplicates, average_length, and total_count, are now camelCase.
    When integrating changes in compass-schema there were updates needed in the telemetry methods, schemaContainsGeoData and calculateSchemaDepth. I ended up refactoring both and hopefully simplifying calculateSchemaDepth a bit, it looks like it might fix a recent error we had. Moved them off the store. Updated tests to be easier to maintain. We could consider moving the calculateSchemaDepth into mongodb-schema, but that's not included in these changes. I'm thinking this should fix COMPASS-6809
    Branch: 6802-dev
    https://github.com/mongodb-js/compass/commit/1f2d29fb2e9529fa6fa8d80f28567a7216fbf975
Comment by Githook User [ 23/May/23 ]

Author:

{'name': 'Rhys', 'email': 'Anemy@users.noreply.github.com', 'username': 'Anemy'}

Message: chore(import-export, schema, field-store): update mongodb-schema, use schema paths helper COMPASS-6720 (#4401)

This updates our mongodb-schema dependency in Compass.

Updating to the new version involves a few changes:

  • Schema field paths now use string arrays instead of dot separated strings. This will make it easier for us to handle cases like dots in field names (previously we would join and split on dots).
  • Better schema type definitions are now exported from mongodb-schema. This involved some changes in compass-schema and compass-import-export as we were supporting our own types.
  • Removed the getSchemaPaths function from compass-import-export and updated to use the one from the mongodb-schema package,.
  • Removed the unused dimensionality and nestedFields properties and calculations in compass-field-store. (could be separated to another pr if preferred).
  • In compass-field-store renamed the aceFields flattened map used for editor field autocompletion to autocompleteFields to be more generic as we are using this in code-mirror and no longer have ace. (could be separated to another pr if preferred).
  • Updated schema property variable names, has_duplicates, average_length, and total_count, are now camelCase.
    When integrating changes in compass-schema there were updates needed in the telemetry methods, schemaContainsGeoData and calculateSchemaDepth. I ended up refactoring both and hopefully simplifying calculateSchemaDepth a bit, it looks like it might fix a recent error we had. Moved them off the store. Updated tests to be easier to maintain. We could consider moving the calculateSchemaDepth into mongodb-schema, but that's not included in these changes. I'm thinking this should fix COMPASS-6809
    Branch: compass-6825-explain-plan-modal-in-agg-builder
    https://github.com/mongodb-js/compass/commit/1f2d29fb2e9529fa6fa8d80f28567a7216fbf975
Comment by Githook User [ 22/May/23 ]

Author:

{'name': 'Rhys', 'email': 'Anemy@users.noreply.github.com', 'username': 'Anemy'}

Message: chore(import-export, schema, field-store): update mongodb-schema, use schema paths helper COMPASS-6720 (#4401)

This updates our mongodb-schema dependency in Compass.

Updating to the new version involves a few changes:

  • Schema field paths now use string arrays instead of dot separated strings. This will make it easier for us to handle cases like dots in field names (previously we would join and split on dots).
  • Better schema type definitions are now exported from mongodb-schema. This involved some changes in compass-schema and compass-import-export as we were supporting our own types.
  • Removed the getSchemaPaths function from compass-import-export and updated to use the one from the mongodb-schema package,.
  • Removed the unused dimensionality and nestedFields properties and calculations in compass-field-store. (could be separated to another pr if preferred).
  • In compass-field-store renamed the aceFields flattened map used for editor field autocompletion to autocompleteFields to be more generic as we are using this in code-mirror and no longer have ace. (could be separated to another pr if preferred).
  • Updated schema property variable names, has_duplicates, average_length, and total_count, are now camelCase.
    When integrating changes in compass-schema there were updates needed in the telemetry methods, schemaContainsGeoData and calculateSchemaDepth. I ended up refactoring both and hopefully simplifying calculateSchemaDepth a bit, it looks like it might fix a recent error we had. Moved them off the store. Updated tests to be easier to maintain. We could consider moving the calculateSchemaDepth into mongodb-schema, but that's not included in these changes. I'm thinking this should fix COMPASS-6809
    Branch: COMPASS-6799-OIDC-connection-form
    https://github.com/mongodb-js/compass/commit/1f2d29fb2e9529fa6fa8d80f28567a7216fbf975
Comment by Githook User [ 22/May/23 ]

Author:

{'name': 'Rhys', 'email': 'Anemy@users.noreply.github.com', 'username': 'Anemy'}

Message: chore(import-export, schema, field-store): update mongodb-schema, use schema paths helper COMPASS-6720 (#4401)

This updates our mongodb-schema dependency in Compass.

Updating to the new version involves a few changes:

  • Schema field paths now use string arrays instead of dot separated strings. This will make it easier for us to handle cases like dots in field names (previously we would join and split on dots).
  • Better schema type definitions are now exported from mongodb-schema. This involved some changes in compass-schema and compass-import-export as we were supporting our own types.
  • Removed the getSchemaPaths function from compass-import-export and updated to use the one from the mongodb-schema package,.
  • Removed the unused dimensionality and nestedFields properties and calculations in compass-field-store. (could be separated to another pr if preferred).
  • In compass-field-store renamed the aceFields flattened map used for editor field autocompletion to autocompleteFields to be more generic as we are using this in code-mirror and no longer have ace. (could be separated to another pr if preferred).
  • Updated schema property variable names, has_duplicates, average_length, and total_count, are now camelCase.
    When integrating changes in compass-schema there were updates needed in the telemetry methods, schemaContainsGeoData and calculateSchemaDepth. I ended up refactoring both and hopefully simplifying calculateSchemaDepth a bit, it looks like it might fix a recent error we had. Moved them off the store. Updated tests to be easier to maintain. We could consider moving the calculateSchemaDepth into mongodb-schema, but that's not included in these changes. I'm thinking this should fix COMPASS-6809
    Branch: 1.37-releases
    https://github.com/mongodb-js/compass/commit/1f2d29fb2e9529fa6fa8d80f28567a7216fbf975
Comment by Githook User [ 22/May/23 ]

Author:

{'name': 'Rhys', 'email': 'Anemy@users.noreply.github.com', 'username': 'Anemy'}

Message: chore(import-export, schema, field-store): update mongodb-schema, use schema paths helper COMPASS-6720 (#4401)

This updates our mongodb-schema dependency in Compass.

Updating to the new version involves a few changes:

  • Schema field paths now use string arrays instead of dot separated strings. This will make it easier for us to handle cases like dots in field names (previously we would join and split on dots).
  • Better schema type definitions are now exported from mongodb-schema. This involved some changes in compass-schema and compass-import-export as we were supporting our own types.
  • Removed the getSchemaPaths function from compass-import-export and updated to use the one from the mongodb-schema package,.
  • Removed the unused dimensionality and nestedFields properties and calculations in compass-field-store. (could be separated to another pr if preferred).
  • In compass-field-store renamed the aceFields flattened map used for editor field autocompletion to autocompleteFields to be more generic as we are using this in code-mirror and no longer have ace. (could be separated to another pr if preferred).
  • Updated schema property variable names, has_duplicates, average_length, and total_count, are now camelCase.
    When integrating changes in compass-schema there were updates needed in the telemetry methods, schemaContainsGeoData and calculateSchemaDepth. I ended up refactoring both and hopefully simplifying calculateSchemaDepth a bit, it looks like it might fix a recent error we had. Moved them off the store. Updated tests to be easier to maintain. We could consider moving the calculateSchemaDepth into mongodb-schema, but that's not included in these changes. I'm thinking this should fix COMPASS-6809
    Branch: main
    https://github.com/mongodb-js/compass/commit/1f2d29fb2e9529fa6fa8d80f28567a7216fbf975
Comment by Githook User [ 20/May/23 ]

Author:

{'name': 'Anna Henningsen', 'email': 'anna.henningsen@mongodb.com', 'username': 'addaleax'}

Message: fix: wrap schema analysis telemetry computation in try/catch HELP-45308 (#4361)

See HELP-45308 / COMPASS-6809.
Branch: COMPASS-6664-guide-cue-stage-wizard
https://github.com/mongodb-js/compass/commit/65fcc876f433a9d1c0367dbd7bf57528fbdad10b

Comment by Githook User [ 15/May/23 ]

Author:

{'name': 'Anna Henningsen', 'email': 'anna.henningsen@mongodb.com', 'username': 'addaleax'}

Message: fix: wrap schema analysis telemetry computation in try/catch HELP-45308 (#4361)

See HELP-45308 / COMPASS-6809.
Branch: 1.37-releases
https://github.com/mongodb-js/compass/commit/65fcc876f433a9d1c0367dbd7bf57528fbdad10b

Comment by Githook User [ 11/May/23 ]

Author:

{'name': 'Anna Henningsen', 'email': 'anna.henningsen@mongodb.com', 'username': 'addaleax'}

Message: fix: wrap schema analysis telemetry computation in try/catch HELP-45308 (#4361)

See HELP-45308 / COMPASS-6809.
Branch: try-mongodb-client-encryption-2.8.0-alpha.1
https://github.com/mongodb-js/compass/commit/65fcc876f433a9d1c0367dbd7bf57528fbdad10b

Comment by Githook User [ 11/May/23 ]

Author:

{'name': 'Anna Henningsen', 'email': 'anna.henningsen@mongodb.com', 'username': 'addaleax'}

Message: fix: wrap schema analysis telemetry computation in try/catch HELP-45308 (#4361)

See HELP-45308 / COMPASS-6809.
Branch: test-read-6.0-QE
https://github.com/mongodb-js/compass/commit/65fcc876f433a9d1c0367dbd7bf57528fbdad10b

Comment by Githook User [ 10/May/23 ]

Author:

{'name': 'Anna Henningsen', 'email': 'anna.henningsen@mongodb.com', 'username': 'addaleax'}

Message: fix: wrap schema analysis telemetry computation in try/catch HELP-45308 (#4361)

See HELP-45308 / COMPASS-6809.
Branch: COMPASS-6769-clean-up-combobox
https://github.com/mongodb-js/compass/commit/65fcc876f433a9d1c0367dbd7bf57528fbdad10b

Comment by Githook User [ 10/May/23 ]

Author:

{'name': 'Anna Henningsen', 'email': 'anna.henningsen@mongodb.com', 'username': 'addaleax'}

Message: fix: wrap schema analysis telemetry computation in try/catch HELP-45308 (#4361)

See HELP-45308 / COMPASS-6809.
Branch: COMPASS-6058-fix-update-on-sharded-collection
https://github.com/mongodb-js/compass/commit/65fcc876f433a9d1c0367dbd7bf57528fbdad10b

Comment by Githook User [ 10/May/23 ]

Author:

{'name': 'Anna Henningsen', 'email': 'anna.henningsen@mongodb.com', 'username': 'addaleax'}

Message: fix: wrap schema analysis telemetry computation in try/catch HELP-45308 (#4361)

See HELP-45308 / COMPASS-6809.
Branch: main
https://github.com/mongodb-js/compass/commit/65fcc876f433a9d1c0367dbd7bf57528fbdad10b

Comment by Githook User [ 10/May/23 ]

Author:

{'name': 'Anna Henningsen', 'email': 'anna@addaleax.net', 'username': 'addaleax'}

Message: fix: wrap schema analysis telemetry computation in try/catch HELP-45308

See HELP-45308 / COMPASS-6809.
Branch: help-45308
https://github.com/mongodb-js/compass/commit/0cc18bb9bd84c7674b6bc33366733da14ef686ff

Generated at Wed Feb 07 22:44:25 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.