[COMPASS-5848] Implicit Conversion of Binary Data While Using Binary(..., 3) Created: 20/May/22  Updated: 29/Oct/23  Resolved: 05/Jul/22

Status: Closed
Project: Compass
Component/s: CRUD
Affects Version/s: None
Fix Version/s: 1.32.3

Type: Bug Priority: Major - P3
Reporter: Ramasai Tadepalli Assignee: Anna Henningsen
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File image (1).png    
Issue Links:
Depends
Story Points: 2
Documentation Changes: Not Needed
Sprint: Iteration Dolphin, Iteration Eel

 Description   

Problem Statement/Rationale

In both Data Explorer and Compass, inserting Binary('mkaTHwEZhaBQj+u1a3D3gA==', 3) using the aggregation pipeline's $addFields stage displays Binary('bWthVEh3RVpoYUJRait1MWEzRDNnQT09', 3). Using $out to persist the value to the collection inserts the latter as well. This seems wrong, because the base64 encoded data that was specified to be inserted is a valid UUID in the JAVA_LEGACY representation, but the inserted binary data is not. It is 24 bytes long instead of 16 bytes, but still has the subtype set to 3, so when the driver tries to decode it, there's an exception thrown (I have tried this with the Java driver, but presumably the behavior for other drivers is the same).{}

Steps to Reproduce

Try to insert the Binary(..., 3) data mentioned above (or any other base64 encoded subtype 3 value that's a valid UUID) and check the data in the collection post insert.

Expected Results

That there be no implicit conversion from base64 to some other representation in the insert process.

Actual Results

That there is some conversion going on, leading to the loss of data.

Additional Notes

Data Explorer is using compass libraries, so this is being observed there as well. 



 Comments   
Comment by Githook User [ 11/Jul/22 ]

Author:

{'name': 'Anna Henningsen', 'email': 'anna.henningsen@mongodb.com', 'username': 'addaleax'}

Message: fix: improve `Binary` handling COMPASS-5848 (#3218)

  • fix(compass-components): do not use `Binary` for displaying Binary data COMPASS-5848

This avoids showing results that cannot be round-tripped
as input data again.

  • fix(hadron-type-checker): use UTF-8 when converting to Binary

Otherwise, data cannot be round-tripped when converting from/to Binary
blobs properly.
Branch: COMPASS-5672-update-crud-toolbar-to-lg
https://github.com/mongodb-js/compass/commit/2b214c425437c053ee6872a0529bf384be3f3fb2

Comment by Githook User [ 11/Jul/22 ]

Author:

{'name': 'Anna Henningsen', 'email': 'anna.henningsen@mongodb.com', 'username': 'addaleax'}

Message: fix: improve `Binary` handling COMPASS-5848 (#3218)

  • fix(compass-components): do not use `Binary` for displaying Binary data COMPASS-5848

This avoids showing results that cannot be round-tripped
as input data again.

  • fix(hadron-type-checker): use UTF-8 when converting to Binary

Otherwise, data cannot be round-tripped when converting from/to Binary
blobs properly.
Branch: 1.32-releases
https://github.com/mongodb-js/compass/commit/2b214c425437c053ee6872a0529bf384be3f3fb2

Comment by Githook User [ 08/Jul/22 ]

Author:

{'name': 'Anna Henningsen', 'email': 'anna.henningsen@mongodb.com', 'username': 'addaleax'}

Message: fix: improve `Binary` handling COMPASS-5848 (#3218)

  • fix(compass-components): do not use `Binary` for displaying Binary data COMPASS-5848

This avoids showing results that cannot be round-tripped
as input data again.

  • fix(hadron-type-checker): use UTF-8 when converting to Binary

Otherwise, data cannot be round-tripped when converting from/to Binary
blobs properly.
Branch: compass-sidebar-merge
https://github.com/mongodb-js/compass/commit/2b214c425437c053ee6872a0529bf384be3f3fb2

Comment by Githook User [ 06/Jul/22 ]

Author:

{'name': 'Anna Henningsen', 'email': 'anna.henningsen@mongodb.com', 'username': 'addaleax'}

Message: fix: improve `Binary` handling COMPASS-5848 (#3218)

  • fix(compass-components): do not use `Binary` for displaying Binary data COMPASS-5848

This avoids showing results that cannot be round-tripped
as input data again.

  • fix(hadron-type-checker): use UTF-8 when converting to Binary

Otherwise, data cannot be round-tripped when converting from/to Binary
blobs properly.
Branch: update-query-history-to-shared-config
https://github.com/mongodb-js/compass/commit/2b214c425437c053ee6872a0529bf384be3f3fb2

Comment by Githook User [ 06/Jul/22 ]

Author:

{'name': 'Anna Henningsen', 'email': 'anna.henningsen@mongodb.com', 'username': 'addaleax'}

Message: fix: improve `Binary` handling COMPASS-5848 (#3218)

  • fix(compass-components): do not use `Binary` for displaying Binary data COMPASS-5848

This avoids showing results that cannot be round-tripped
as input data again.

  • fix(hadron-type-checker): use UTF-8 when converting to Binary

Otherwise, data cannot be round-tripped when converting from/to Binary
blobs properly.
Branch: COMPASS-5120-update-compass-icon
https://github.com/mongodb-js/compass/commit/2b214c425437c053ee6872a0529bf384be3f3fb2

Comment by Githook User [ 06/Jul/22 ]

Author:

{'name': 'Anna Henningsen', 'email': 'anna.henningsen@mongodb.com', 'username': 'addaleax'}

Message: fix: improve `Binary` handling COMPASS-5848 (#3218)

  • fix(compass-components): do not use `Binary` for displaying Binary data COMPASS-5848

This avoids showing results that cannot be round-tripped
as input data again.

  • fix(hadron-type-checker): use UTF-8 when converting to Binary

Otherwise, data cannot be round-tripped when converting from/to Binary
blobs properly.
Branch: update-compass-crud-to-shared-config
https://github.com/mongodb-js/compass/commit/2b214c425437c053ee6872a0529bf384be3f3fb2

Comment by Githook User [ 06/Jul/22 ]

Author:

{'name': 'Anna Henningsen', 'email': 'anna.henningsen@mongodb.com', 'username': 'addaleax'}

Message: fix: improve `Binary` handling COMPASS-5848 (#3218)

  • fix(compass-components): do not use `Binary` for displaying Binary data COMPASS-5848

This avoids showing results that cannot be round-tripped
as input data again.

  • fix(hadron-type-checker): use UTF-8 when converting to Binary

Otherwise, data cannot be round-tripped when converting from/to Binary
blobs properly.
Branch: COMPASS-5673-query-bar
https://github.com/mongodb-js/compass/commit/2b214c425437c053ee6872a0529bf384be3f3fb2

Comment by Githook User [ 06/Jul/22 ]

Author:

{'name': 'Anna Henningsen', 'email': 'anna.henningsen@mongodb.com', 'username': 'addaleax'}

Message: fix: improve `Binary` handling COMPASS-5848 (#3218)

  • fix(compass-components): do not use `Binary` for displaying Binary data COMPASS-5848

This avoids showing results that cannot be round-tripped
as input data again.

  • fix(hadron-type-checker): use UTF-8 when converting to Binary

Otherwise, data cannot be round-tripped when converting from/to Binary
blobs properly.
Branch: compass-settings
https://github.com/mongodb-js/compass/commit/2b214c425437c053ee6872a0529bf384be3f3fb2

Comment by Githook User [ 06/Jul/22 ]

Author:

{'name': 'Anna Henningsen', 'email': 'anna.henningsen@mongodb.com', 'username': 'addaleax'}

Message: fix: improve `Binary` handling COMPASS-5848 (#3218)

  • fix(compass-components): do not use `Binary` for displaying Binary data COMPASS-5848

This avoids showing results that cannot be round-tripped
as input data again.

  • fix(hadron-type-checker): use UTF-8 when converting to Binary

Otherwise, data cannot be round-tripped when converting from/to Binary
blobs properly.
Branch: COMPASS-5806-automatically-refresh-after-csfle-insert
https://github.com/mongodb-js/compass/commit/2b214c425437c053ee6872a0529bf384be3f3fb2

Comment by Githook User [ 05/Jul/22 ]

Author:

{'name': 'Anna Henningsen', 'email': 'anna.henningsen@mongodb.com', 'username': 'addaleax'}

Message: fix: improve `Binary` handling COMPASS-5848 (#3218)

  • fix(compass-components): do not use `Binary` for displaying Binary data COMPASS-5848

This avoids showing results that cannot be round-tripped
as input data again.

  • fix(hadron-type-checker): use UTF-8 when converting to Binary

Otherwise, data cannot be round-tripped when converting from/to Binary
blobs properly.
Branch: main
https://github.com/mongodb-js/compass/commit/2b214c425437c053ee6872a0529bf384be3f3fb2

Comment by Githook User [ 28/Jun/22 ]

Author:

{'name': 'Anna Henningsen', 'email': 'anna.henningsen@mongodb.com', 'username': 'addaleax'}

Message: fix(compass-components): do not use `Binary` for displaying Binary data COMPASS-5848

This avoids showing results that cannot be round-tripped
as input data again.
Branch: 5848-dev
https://github.com/mongodb-js/compass/commit/b4df869242a5934ed8075eb83fa6b7a8b26f68ef

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