Skip to content

feat(account): carry message edit/delete windows on UserFlags - #721

Merged
bmc08gt merged 4 commits into
mainfrom
feat/user-flags-message-windows
Sep 3, 2026
Merged

feat(account): carry message edit/delete windows on UserFlags#721
bmc08gt merged 4 commits into
mainfrom
feat/user-flags-message-windows

Conversation

@bmc08gt

@bmc08gt bmc08gt commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

Carries the two new UserFlags durations 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-protocol 0.4.0 is 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 the exact: "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, both google.protobuf.Duration with explicit presence:

  • message_edit_window = 17 — the window after a message is created during which it can still be edited
  • message_delete_window = 18 — the same, for deletion

Nothing 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

UserFlags gains messageEditWindow: TimeInterval? and messageDeleteWindow: TimeInterval?, mapped in init(_ proto:) behind proto.hasMessageEditWindow / proto.hasMessageDeleteWindow, so an unset field stays nil rather than becoming a zero-length window. That is the same presence pattern the file already uses for billExchangeDataTimeout.

No service or wrapper changes were needed: AccountService.fetchUserFlags already builds UserFlags(response.userFlags), and the model persists as a JSON blob in UserFlagsTable, so Codable synthesises decodeIfPresent for the new optionals with no schema or SQLiteVersion bump.

The remaining diff is the memberwise-init call sites in tests, which the struct's no-default init requires. Database+ProfileTests now round-trips one fixture with the windows set and one with them nil.

Scope

No edit or delete behaviour is wired up. MessagePolicy.editWindow is the obvious next consumer — it exists and is currently always nil — but gating actual UI is left for a follow-up.

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.
@bmc08gt
bmc08gt merged commit 5ade00d into main Sep 3, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant