Skip to content

Sample Spring Boot Data Mongodb project to reproduce a bug in SimpleReactiveMongoRepository#saveAll

License

Notifications You must be signed in to change notification settings

petitcl/spring-data-mongodb-sample-1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spring Data Mongodb Sample #1

Bug description

When using the Flux<S> saveAll(Publisher<S> entityStream) method from the SimpleReactiveMongoRepository class, the returned entities do not have their id property populated, in the case where the field annotated with @Id class is immutable.

The bug only affects the version of saveAll that accepts a Publisher. The version of saveAll that accepts an Iterable is not affected by this bug, neither is the version of insert that accepts a Publisher.

The bug was reproduced in the following Spring Boot / Spring data versions:

  • spring-boot-starter-parent 2.4.4, spring-data-mongodb 3.1.6, spring-data-commons 2.4.6
  • spring-boot-starter-parent 2.3.9, spring-data-mongodb 3.0.7, spring-data-commons 2.3.7
  • spring-boot-starter-parent 2.2.13, spring-data-mongodb 2.2.12, spring-data-commons 2.2.12

Steps to reproduce

  1. Run the unit tests with mvn test
  2. See that the ImmutableEntityTest#test_saveAllFlux_deserializesWellEntity test fails although it shouldn't
  3. See that all the other unit tests are passing

History

An issue was created for this bug in the spring-data-mongodb github repository: #3609.

The bug was then fixed via #3611.

About

Sample Spring Boot Data Mongodb project to reproduce a bug in SimpleReactiveMongoRepository#saveAll

Topics

Resources

License

Stars

Watchers

Forks

Languages