Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rx set operation w/ SetArgs returns value itself instead of a String #159

Closed
joshdurbin opened this issue Dec 7, 2015 · 3 comments
Closed
Labels
type: bug A general bug

Comments

@joshdurbin
Copy link

With a custom codec defined, 'set' operations (and possibly other operations) with SetArgs return an Observable of a specified type (matching the codec). The emitted item from this operation is essentially a String, which represents the redis server response for the operation, eg: "OK". Given that the method signature states it returns an object of the specified type (again, matching the codec), the codec's decodeValue method is executed with the input "OK" (or other response, if there's an error).

Unless the codec is written to decode this response in additional to actual, expected responses, it will bomb.

In testing, an unmodified codec (unmodified to handle the response, but working otherwise), the method signature below works:

Observable<String> set(K key, V value)

...while this method signature fails w/ a codec exception of an unhanded "OK":

Observable<V> set(K key, V value, SetArgs setArgs)

@joshdurbin joshdurbin changed the title w/ a custom codec, the 'set' operation w/ SetArgs invokes the decode method w/ string representation of redis' response: ex: 'OK' rx set operation w/ SetArgs returns value itself instead of a String Dec 7, 2015
@mp911de mp911de added the type: bug A general bug label Dec 10, 2015
@mp911de
Copy link
Collaborator

mp911de commented Dec 10, 2015

Thank you for reporting the bug. The method return type is required to change from V to String to fix the bug.

This bug affects 3.x and 4.x version. It will be fixed with 3.3.2.Final, 4.0.2.Final and the bugfix will be included in the future 3.4 and 4.1 versions.

mp911de added a commit that referenced this issue Dec 10, 2015
Signature of the set method with SetArgs returned the value instead of the string status response. This mismatch gets obvious when using custom codes with value types other than String.

This commit changes the API to fix the mismatch.
mp911de added a commit that referenced this issue Dec 10, 2015
Signature of the set method with SetArgs returned the value instead of the string status response. This mismatch gets obvious when using custom codes with value types other than String.

This commit changes the API to fix the mismatch.
mp911de added a commit that referenced this issue Dec 10, 2015
Signature of the set method with SetArgs returned the value instead of the string status response. This mismatch gets obvious when using custom codes with value types other than String.

This commit changes the API to fix the mismatch.
mp911de added a commit that referenced this issue Dec 10, 2015
Signature of the set method with SetArgs returned the value instead of the string status response. This mismatch gets obvious when using custom codes with value types other than String.

This commit changes the API to fix the mismatch.
@mp911de
Copy link
Collaborator

mp911de commented Dec 11, 2015

Fixed.

@mp911de mp911de closed this as completed Dec 11, 2015
@mp911de
Copy link
Collaborator

mp911de commented Dec 11, 2015

Released 3.3.2.Final and 4.0.2.Final to Maven central.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

No branches or pull requests

2 participants