vertx-redis-client icon indicating copy to clipboard operation
vertx-redis-client copied to clipboard

Fix initialization of RedisOptions and Redis[*]ConnectOptions

Open Ladicek opened this issue 1 year ago • 3 comments

This commit makes sure that:

  • all mandatory fields of RedisOptions are initialized (initializing them only in Redis[*]ConnectOptions is not enough due to the usage of copy constructors);
  • all constructors of subclasses of RedisConnectOptions properly delegate to the corresponding superclass constructors;
  • the JsonObject-accepting constructors of subclasses of RedisConnectOptions call the correct conversion function, after delegating to the corresponding superclass constructor, which calls its own conversion function.

Ladicek avatar Feb 06 '24 16:02 Ladicek

should we have tests for this @Ladicek ?

vietj avatar Mar 07 '24 10:03 vietj

Good point! Let me figure out some tests for this.

Ladicek avatar Mar 07 '24 10:03 Ladicek

Added tests. Thanks for insisting on it, I actually discovered a few more subtle bugs -- most importantly, the JSON serialization/deserialization used to get/set the endpoints list multiple times, due to the existence of multiple getter/setter pairs, and that could actually lead to loss of information.

Ladicek avatar Mar 07 '24 15:03 Ladicek

thank you @Ladicek

vietj avatar Mar 20 '24 10:03 vietj