[COMPASS-7132] Updating document string value to "[object Object]" turns into empty string Created: 21/Aug/23  Updated: 29/Oct/23  Resolved: 24/Aug/23

Status: Closed
Project: Compass
Component/s: None
Affects Version/s: 1.39.1, 1.39.2
Fix Version/s: 1.39.4

Type: Bug Priority: Minor - P4
Reporter: Eric Dilmore Assignee: Maurizio Casimirri
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

OS: Windows 10
node.js / npm versions:
Additional info: Compass 1.39.1


Attachments: PNG File image-2023-08-21-11-41-43-993.png     PNG File image-2023-08-21-11-42-11-940.png     PNG File image-2023-08-21-11-45-15-544.png    
Documentation Changes: Not Needed

 Description   

Problem Statement/Rationale

 When I type a string literal into the document update box, I expect that the string will accept any valid Unicode input. However, typing "[object Object]" will reset the field to an empty string when the closing brace is typed.

Prior  to typing the closing brace, this is what the text looks like.

After typing the final closing brace, the string becomes empty. I can do this again by typing "[object Object]" again, even without closing the edit document window or without restarting the application. When update is clicked, the empty string is saved to the document.

Other similar strings do not have this behavior. Examples are "[]", "[foobar]", and "[object Objects]".

Please be sure to attach relevant logs with any sensitive data redacted.
How to retrieve logs for: Compass; Shell

After checking the logs, I don't see anything relevant, since the actions taken involve keypresses without sending the update. Please contact me if you have trouble reproducing.

Steps to Reproduce

  1. Open a collection with at least one document with a string field.
  2. Double click on the string value to enter "Edit Document" mode.
  3. Type "[object Object]" (no quotes) into the field.

Expected Results

The new pending field value is "[object Object]".

Actual Results

The new pending field value is "".

Additional Notes

While this is an odd document modification, it is something I was required to do to test a script to fix broken data. I am unaware if there are any other magic strings that cause similar problems.



 Comments   
Comment by Githook User [ 05/Sep/23 ]

Author:

{'name': 'Maurizio Casimirri', 'email': 'maurizio.cas@gmail.com', 'username': 'mcasimir'}

Message: fix: allow [object Object] as a valid string value in TypeChecker COMPASS-7132 (#4754)
Branch: ga-releases
https://github.com/mongodb-js/compass/commit/5b924f022952eca8b5bec384b1a7a180b4c8a548

Comment by Githook User [ 04/Sep/23 ]

Author:

{'name': 'Maurizio Casimirri', 'email': 'maurizio.cas@gmail.com', 'username': 'mcasimir'}

Message: fix: allow [object Object] as a valid string value in TypeChecker COMPASS-7132 (#4754)
Branch: beta-releases
https://github.com/mongodb-js/compass/commit/5b924f022952eca8b5bec384b1a7a180b4c8a548

Comment by Githook User [ 30/Aug/23 ]

Author:

{'name': 'Maurizio Casimirri', 'email': 'maurizio.cas@gmail.com', 'username': 'mcasimir'}

Message: fix: allow [object Object] as a valid string value in TypeChecker COMPASS-7132 (#4754)
Branch: validate-fs-data
https://github.com/mongodb-js/compass/commit/5b924f022952eca8b5bec384b1a7a180b4c8a548

Comment by Githook User [ 30/Aug/23 ]

Author:

{'name': 'Maurizio Casimirri', 'email': 'maurizio.cas@gmail.com', 'username': 'mcasimir'}

Message: fix: allow [object Object] as a valid string value in TypeChecker COMPASS-7132 (#4754)
Branch: COMPASS-7073-align-storages
https://github.com/mongodb-js/compass/commit/5b924f022952eca8b5bec384b1a7a180b4c8a548

Comment by Githook User [ 30/Aug/23 ]

Author:

{'name': 'Maurizio Casimirri', 'email': 'maurizio.cas@gmail.com', 'username': 'mcasimir'}

Message: fix: allow [object Object] as a valid string value in TypeChecker COMPASS-7132 (#4754)
Branch: compass-7112-add-atlas-service-tracking
https://github.com/mongodb-js/compass/commit/5b924f022952eca8b5bec384b1a7a180b4c8a548

Comment by Githook User [ 29/Aug/23 ]

Author:

{'name': 'Maurizio Casimirri', 'email': 'maurizio.cas@gmail.com', 'username': 'mcasimir'}

Message: fix: allow [object Object] as a valid string value in TypeChecker COMPASS-7132 (#4754)
Branch: main
https://github.com/mongodb-js/compass/commit/5b924f022952eca8b5bec384b1a7a180b4c8a548

Comment by Githook User [ 23/Aug/23 ]

Author:

{'name': 'Maurizio Casimirri', 'email': 'maurizio.cas@gmail.com', 'username': 'mcasimir'}

Message: fix: allow [object Object] as a valid string value in TypeChecker COMPASS-7132
Branch: COMPASS-7132
https://github.com/mongodb-js/compass/commit/5b8c92a44a5a057eb1e292ab4baccd01f85b7da0

Comment by Eric Dilmore [ 21/Aug/23 ]

I meant to also add my workaround, which is that this update is simple to perform by using `updateOne` in the mongo shell. The Compass interface appears to be where the problem lies.

Comment by PM Bot [ 21/Aug/23 ]

Hello eric.dilmore@oakstreethealth.com, thank you for reaching out to us! The team will review your issue and get back to you soon as soon as possible.

Please review your issue to ensure you've included your environment details and have attached relevant logs (with any sensitive data redacted), so that we're best able to provide you a timely and thorough response. Thanks again!

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