[JAVA-3382] Observables should filter null values Created: 14/Aug/19  Updated: 28/Oct/23  Resolved: 23/Aug/19

Status: Closed
Project: Java Driver
Component/s: Async
Affects Version/s: None
Fix Version/s: 3.11.1

Type: Bug Priority: Minor - P4
Reporter: Ross Lawley Assignee: John Stewart (Inactive)
Resolution: Fixed Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to JAVA-3279 distinct on using non-sparse index th... Closed

 Description   

Unfortunately, throwing a NPE when seeing a null value in the AbstractSubscription class had some unintended consequences.

Any async method that returns Void (eg Start transaction, abort transaction etc..) and find()#first() all would throw a NPE. A hotfix had to be implemented in SCALA-555 and JAVARS-209 to work around the limitation but there may be edge cases where NPE's can still be raised.

Given that we are in control of providing the data to consumers, throwing a NPE is unhelpful and prevents the normal flow of Observables.



 Comments   
Comment by Githook User [ 10/Oct/19 ]

Author:

{'name': 'John Stewart', 'username': 'jstewart-mongo', 'email': 'john.stewart@mongodb.com'}

Message: Filter null values for Observables

JAVA-3382
Branch: 3.11.x
https://github.com/mongodb/mongo-java-driver/commit/99e1eded02222f14bbb33a4c29a6c77e09281822

Comment by Githook User [ 23/Aug/19 ]

Author:

{'name': 'John Stewart', 'email': 'john.stewart@mongodb.com', 'username': 'jstewart-mongo'}

Message: Filter null values for Observables

JAVA-3382
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/1fc484c2c257ef8efc843657a3dd59f10bf13c82

Generated at Thu Feb 08 08:59:29 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.