From 5fcbde8803bb33dba8dba3d9ed38dd1d5ea21a15 Mon Sep 17 00:00:00 2001 From: Brandon McAnsh Date: Mon, 27 Jul 2026 16:23:57 -0400 Subject: [PATCH 1/2] fix(tips): pad tip code payload reserved bytes with a non-zero sentinel The tip payload left the reserved trailing bytes (17-19) zero. KikCodes.decode strips trailing zero bytes, so a frame whose reserved region (or user id tail) is zero comes back short. Fill the reserved region with incrementing digits (1, 2, 3) on encode so the frame always ends non-zero and round-trips at full length. Decoding still re-pads for legacy zero-trailing frames. Mirrors Android #1163. --- .../Main/Bill/TipCode.Payload+Encoding.swift | 17 +++++++++++++++-- FlipcashTests/TipCodeEncodingTests.swift | 18 ++++++++++++++---- 2 files changed, 29 insertions(+), 6 deletions(-) diff --git a/Flipcash/Core/Screens/Main/Bill/TipCode.Payload+Encoding.swift b/Flipcash/Core/Screens/Main/Bill/TipCode.Payload+Encoding.swift index 96fb40b1..0e8729ff 100644 --- a/Flipcash/Core/Screens/Main/Bill/TipCode.Payload+Encoding.swift +++ b/Flipcash/Core/Screens/Main/Bill/TipCode.Payload+Encoding.swift @@ -17,13 +17,22 @@ nonisolated extension TipCode.Payload { private static let userIDRange = 1..<17 + /// The trailing reserved bytes, filled with a non-zero sentinel on encode. + private static let reservedRange = 17.. Date: Mon, 27 Jul 2026 16:59:58 -0400 Subject: [PATCH 2/2] fix(chat): restore dropped comma when merging code/main into the tip payload branch The #524 (focusOnAppear) and #525 (isTipDm) conversation-bar params were integrated on main without a separator between them, leaving ConversationScreen and ChatScreenRepresentable non-compiling. Add the missing commas so the tree builds. --- .../Core/Screens/Conversation/ChatScreenRepresentable.swift | 2 +- Flipcash/Core/Screens/Conversation/ConversationScreen.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Flipcash/Core/Screens/Conversation/ChatScreenRepresentable.swift b/Flipcash/Core/Screens/Conversation/ChatScreenRepresentable.swift index 1d38c0fa..1cd72b0e 100644 --- a/Flipcash/Core/Screens/Conversation/ChatScreenRepresentable.swift +++ b/Flipcash/Core/Screens/Conversation/ChatScreenRepresentable.swift @@ -102,7 +102,7 @@ struct ChatScreenRepresentable: UIViewControllerRepresentable { symbol: symbol, onSendCash: onSendCash, model: barModel, - focusOnAppear: focusOnAppear + focusOnAppear: focusOnAppear, isTipDm: isTipDm ) .environment(conversationController) diff --git a/Flipcash/Core/Screens/Conversation/ConversationScreen.swift b/Flipcash/Core/Screens/Conversation/ConversationScreen.swift index 0865f6c9..ba3ec93d 100644 --- a/Flipcash/Core/Screens/Conversation/ConversationScreen.swift +++ b/Flipcash/Core/Screens/Conversation/ConversationScreen.swift @@ -172,7 +172,7 @@ struct ConversationScreen: View { onSendCash: sendCash, conversationController: conversationController, barModel: barModel, - focusOnAppear: openKeyboard + focusOnAppear: openKeyboard, isTipDm: tipCounterpart != nil ) .ignoresSafeArea(.keyboard)