Page MenuHomePhorge

Do not add an optional null json value to request body
ClosedPublic

Authored by tusooa on Aug 10 2024, 9:24 PM.
Tags
None
Referenced Files
F30355: D162.1726900793.diff
Thu, Sep 19, 11:39 PM
F30195: D162.1726890813.diff
Thu, Sep 19, 8:53 PM
Unknown Object (File)
Sun, Sep 15, 9:18 PM
Unknown Object (File)
Fri, Sep 6, 1:20 PM
Unknown Object (File)
Fri, Sep 6, 12:31 PM
Unknown Object (File)
Tue, Sep 3, 3:44 AM
Unknown Object (File)
Mon, Sep 2, 5:51 PM
Unknown Object (File)
Mon, Sep 2, 2:42 PM
Subscribers
None

Details

Summary

We used to add a JsonWrap unconditionally to the request body even if it is not a required parameter. This has caused several problems in the past, which we have fixed by explicitly setting the problematic values to, say, an empty map or array. This time, it causes conduwuit to reject our request to upload keys because it wrongfully sends a null value in one_time_keys, but it is expecting a map, or the kv should not appear in the body at all.

We now fix this for good by adding a null check for JsonWrap values in addToJsonIfNeeded().

Type: fix

BUG: https://iron.lily-is.land/T133

Test Plan

Build kazv against this. Verify you can connect to a conduwuit server and sync successfully.

Diff Detail

Repository
rL libkazv
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Please add a changelog type to the summary, using the following format:

Type: (add|remove|skip|security|fix)

tusooa removed a reviewer: servant.
This revision is now accepted and ready to land.Aug 13 2024, 10:12 PM