Skip to content

Conversation

@mabaasit
Copy link
Collaborator

@mabaasit mabaasit commented Jan 28, 2025

Light Mode image
Dark Mode image

Description

Checklist

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)

@mabaasit mabaasit changed the title feat(databases-collections): handle non-existant namespaces COMPASS-5750 feat(databases-collections): handle non-existent namespaces COMPASS-5750 Jan 29, 2025
Comment on lines +255 to +264
// If the collection is not unprovisioned `is_non_existent` anymore,
// let's update the parent database model to reflect the change.
// This happens when a user tries to insert first document into a
// collection that doesn't exist yet or creates a new collection
// for an unprovisioned database.
if (!this.is_non_existent) {
getParentByType(this, 'Database').set({
is_non_existent: false,
});
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not sure if this is the right place for this, but if you feel it does not belong here, let me know

@mabaasit mabaasit marked this pull request as ready for review January 29, 2025 12:08
Comment on lines 812 to +817
void dispatch(fetchCollectionInfo(workspaceOptions));
}

if (workspaceOptions.type === 'Collections') {
// Fetching extra metadata for database should not block tab opening
void dispatch(fetchDatabaseInfo(workspaceOptions));
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Created COMPASS-8897 to clean this up.

Comment on lines +117 to +119
isTimeSeries: collection.isTimeSeries,
isReadonly: collection.readonly ?? collection.isView,
sourceName: collection.sourceName,
Copy link
Collaborator

Choose a reason for hiding this comment

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

For case like this I'd probably prefer to either have a dedicated action or subscribe to all fields you're updating, otherwise you're listening here to one thing, but updating others, it's a but confusing to navigate. Taking into account we're going to refactor this, that's fine for now

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

great point. with refactor in mind, i'll merge this for now!

@mabaasit mabaasit merged commit 3797a5f into main Jan 31, 2025
31 of 32 checks passed
@mabaasit mabaasit deleted the COMPASS-5750-non-existent-ns branch January 31, 2025 23:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants