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
F114573: D162.1732566499.diff
Sun, Nov 24, 12:28 PM
F114471: D162.1732551362.diff
Sun, Nov 24, 8:16 AM
F113985: D162.1732499735.diff
Sat, Nov 23, 5:55 PM
F113984: D162.1732499730.diff
Sat, Nov 23, 5:55 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