-
Notifications
You must be signed in to change notification settings - Fork 218
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
Fix #1426 IllegalStateException when deserializing message using conversations.history #1429
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1429 +/- ##
============================================
- Coverage 73.14% 73.12% -0.03%
- Complexity 4375 4386 +11
============================================
Files 474 475 +1
Lines 14209 14243 +34
Branches 1438 1447 +9
============================================
+ Hits 10393 10415 +22
- Misses 2969 2973 +4
- Partials 847 855 +8 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems good 💯
Just for my own understanding, if the groups
field is not an array then its content gets removed and if shares.public
or shares.private
are present then their reply_users
fields are not arrays they also get removed?
public class GsonFileFactory implements JsonDeserializer<File>, JsonSerializer<File> { | ||
|
||
// This is just a workaround to customize Gson library behavior | ||
// You don't need to edit this class at all |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure I understand this comment, do we still need it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As mentioned below, if you run context.deserialize(jsonObject, File.class);
within the deserialize method, it results in StackOverflowError because the same method is associated with the File.class. To let gson mechansim to run a different auto-binding process without stack overflow, I've added this sub class. This is internal hidden class, so you can rename it whenever you want to do so. Also, if you find a better solution to achive the same, please feel free to change this part. It won't be a breaking change because this class and the the code using it are hidden from users.
…ing conversation.history
d2a1f9b
to
5901635
Compare
This pull request resolves #1426
Category (place an
x
in each of the[ ]
)Requirements
Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you agree to those rules.