Skip to content

refactor(storage): refactor CompassQueryStorage to accept storage backend rather than userData COMPASS-9489 #7058

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

nvs119
Copy link
Contributor

@nvs119 nvs119 commented Jun 26, 2025

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
  • 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)

Comment on lines +98 to +99
// will throwing Errors here be bubbled up properly?
// or should I return undefined or null?
Copy link
Collaborator

Choose a reason for hiding this comment

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

UserData and dependant services allow to use "update" as "create" in cases where the item doesn't exist yet, so this shouldn't throw

await this.userData.write(id, updated as z.input<TSchema>);
const after = await this.readOne(id);
if (!after) {
throw new Error(`Failed to update record for id ${id}`);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Similarly we usually don't throw from these when write failed. Generally speaking I'd suggest to align with the current behavior of those without changing it

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.

2 participants