feat(account): carry message edit/delete windows on UserFlags - #721
Merged
Conversation
UserFlags gained two message-typed Duration fields (17, 18) upstream: message_edit_window and message_delete_window. Map them onto UserFlags as optional TimeIntervals, gated on hasMessageEditWindow / hasMessageDeleteWindow so an absent window is not read as zero, matching the existing billExchangeDataTimeout convention. Scaffolding only, nothing reads these yet. A follow-up wires them into MessagePolicy for the chat edit/delete affordances.
Picks up messageEditWindow and messageDeleteWindow on UserFlags. Blocked until 0.4.0 is published; ocp-client-protocol is unaffected and stays at 0.2.0.
b5432cc moved the pin in FlipcashAPI/Package.swift to 0.4.0 but left the workspace Package.resolved resolving 0.2.0, so the manifest and the lockfile disagreed and the next build to touch the workspace rewrote it. CLAUDE.md requires the workspace Package.resolved be committed. The revision matches the 0.4.0 tag (27e3f09a). ocp-client-protocol is untouched and stays at 0.2.0, which its pin and lockfile entry already agree on.
Keeps iOS on the same package version as Android. 0.3.0 over 0.2.0 is Android-only content — R8 keep rules for the generated messages, plus CHANGELOG and README. No .proto and no Swift changed, so this carries no contract change and nothing in FlipcashAPI moves. Pin and workspace lockfile updated together; the revision matches the 0.3.0 tag (7c37ecc0). Verified with Scripts/build.sh, which resolved 0.3.0 and left the lockfile entry as written.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Carries the two new
UserFlagsdurations from flipcash2-protobuf-api#89 into the domain model, and pins the contract package release that carries them.Blocked on the release
Draft until
flipcash2-client-protocol0.4.0is tagged. That tag does not exist yet — it is pushed by the publish run on flipcash2-client-protocol#7, which has to merge first. Until then theexact: "0.4.0"requirement has nothing to resolve.The work was developed and tested against the client checkout directly, via
FLIPCASH_PROTO_LOCAL. CI never sees that override — it is a shell variable — so it resolves the pin and nothing else.Contract change
Two fields appended to
account.v1.UserFlags, bothgoogle.protobuf.Durationwith explicit presence:message_edit_window = 17— the window after a message is created during which it can still be editedmessage_delete_window = 18— the same, for deletionNothing else in the contract moved, and no enum gained or reordered a case, so there is no
Error*(rawValue:)renumbering hazard here.What this does
UserFlagsgainsmessageEditWindow: TimeInterval?andmessageDeleteWindow: TimeInterval?, mapped ininit(_ proto:)behindproto.hasMessageEditWindow/proto.hasMessageDeleteWindow, so an unset field staysnilrather than becoming a zero-length window. That is the same presence pattern the file already uses forbillExchangeDataTimeout.No service or wrapper changes were needed:
AccountService.fetchUserFlagsalready buildsUserFlags(response.userFlags), and the model persists as a JSON blob inUserFlagsTable, soCodablesynthesisesdecodeIfPresentfor the new optionals with no schema orSQLiteVersionbump.The remaining diff is the memberwise-init call sites in tests, which the struct's no-default init requires.
Database+ProfileTestsnow round-trips one fixture with the windows set and one with themnil.Scope
No edit or delete behaviour is wired up.
MessagePolicy.editWindowis the obvious next consumer — it exists and is currently alwaysnil— but gating actual UI is left for a follow-up.