Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/3-bug-fixes/client-id-leading-zeros
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Prevent client IDs with leading zeros from being generated. This works around a type mismatch in the protobuf API, where client IDs are represented as uint64.
2 changes: 2 additions & 0 deletions libs/wire-api/src/Wire/API/User/Client/Prekey.hs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import Data.ByteString.Conversion (toByteString')
import Data.Id
import Data.OpenApi qualified as S
import Data.Schema
import Data.Text qualified as T
import Data.Text.Ascii (encodeBase16)
import Data.Text.Encoding (decodeUtf8, encodeUtf8)
import Imports
Expand Down Expand Up @@ -70,6 +71,7 @@ instance ToSchema Prekey where
clientIdFromPrekey :: Prekey -> ClientId
clientIdFromPrekey =
ClientId
. T.dropWhile (== '0')
Comment thread
pcapriotti marked this conversation as resolved.
. decodeUtf8
. toByteString'
. encodeBase16
Expand Down