Skip to content

fix(mongo): silent 0-match updateOne looks like a successful save #776

Description

@ZhuchkaTriplesix

Summary

MongoService.updateDocument awaits coll.updateOne(filter, update) and returns void. mongo_dart does not throw when nMatched == 0 (wrong _id type, deleted doc, replica lag). Inspector then _load()s and the field looks unchanged with no error.

Same class of lie as 0-row SQL DML.

Scope

  • Inspect WriteResult / nMatched / nModified after updateOne and deleteOne.
  • Throw (or return a result) when filter matched 0 documents.
  • Surface in inspector / full-doc editor as Save Failed.

Out of scope

  • Retry / conflict UI.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    backendBackend database driver execution and queriesbugSomething isn't workingerror-handlingTheme parser epic label: error-handling

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions