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
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
Unknown Object (File)
Mon, Sep 2, 4:48 AM
Unknown Object (File)
Sat, Aug 31, 4:43 AM
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
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