Page MenuHomePhorge

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

Authored by tusooa on Aug 10 2024, 9:24 PM.

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
Branch
tusooa/stacked
Lint
No Lint Coverage
Unit
No Test Coverage
Build Status
Buildable 260
Build 508: GitLab CI for libkazv
Build 507: arc lint + arc unit

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