Skip to content

Conversation

@addaleax
Copy link
Collaborator

PR created via the autofixer in mongodb-js/devtools-shared#604

Description

Checklist

  • New tests and/or benchmarks are included
  • Documentation is changed or added
  • If this change updates the UI, screenshots/videos are added and a design review is requested
  • If this change could impact the load on the MongoDB cluster, please describe the expected and worst case impact
  • I have signed the MongoDB Contributor License Agreement (https://www.mongodb.com/legal/contributor-agreement)

Motivation and Context

  • Bugfix
  • New feature
  • Dependency update
  • Misc

Open Questions

Dependents

Types of changes

  • Backport Needed
  • Patch (non-breaking change which fixes an issue)
  • Minor (non-breaking change which adds functionality)
  • Major (fix or feature that would cause existing functionality to change)

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates object initialization patterns throughout the codebase to use null prototype objects for Record types, eliminating potential prototype pollution risks and improving security. This is an automated refactoring that consistently applies this pattern across multiple packages.

  • Replaces {} initialization with Object.create(null) for Record types
  • Adds __proto__: null to object literals used as Record types
  • Applies changes across data service, CRUD operations, query utilities, and menu handling

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/mongodb-query-util/src/in-value-range.ts Adds null prototype to comparison operators Record
packages/hadron-document/src/object-generator.ts Updates object generation to use null prototype initialization
packages/data-service/src/data-service.ts Applies null prototype to aggregation pipeline stage objects
packages/compass-electron-menu/src/application-menu.spec.tsx Updates test handler roles Record initialization
packages/compass-crud/src/stores/grid-store.ts Updates params Record in element removal handler
packages/compass-crud/src/stores/crud-store.spec.ts Updates localStorage mock initialization in tests
packages/compass-crud/src/components/table-view/document-table-view.tsx Updates multiple Record initializations for column state and headers
packages/compass-crud/src/components/change-view/bson-utils.ts Updates object mapping in BSON utility function

@Anemy Anemy added the no-title-validation Skips validation of PR titles (conventional commit adherence + JIRA ticket inclusion) label Dec 15, 2025
@addaleax addaleax merged commit f232bba into main Dec 15, 2025
102 of 107 checks passed
@addaleax addaleax deleted the eslint-no-plain-object-records branch December 15, 2025 21:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-title-validation Skips validation of PR titles (conventional commit adherence + JIRA ticket inclusion)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants