Skip to content

feat(flipcash): thread message edit/delete windows through UserFlags - #1397

Merged
bmc08gt merged 2 commits into
code/cashfrom
feat/user-flags-message-windows
Sep 3, 2026
Merged

feat(flipcash): thread message edit/delete windows through UserFlags#1397
bmc08gt merged 2 commits into
code/cashfrom
feat/user-flags-message-windows

Conversation

@bmc08gt

@bmc08gt bmc08gt commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

Threads the two new UserFlags durations from flipcash2-protobuf-api#89 through to the domain layer, and pins the contract package release that carries them.

Blocked on the release

Draft until com.flipcash:flipcash2-client-protocol:0.4.0 is on Maven Central. That version does not exist yet — it is published from flipcash2-client-protocol#7, which has to merge first. Until then CI reports com.flipcash:flipcash2-client-protocol:0.4.0 FAILED at resolution.

The scaffolding was developed and tested against the client checkout directly, via protoLocalRoot in local.properties. CI never sees that override — local.properties is untracked — 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 nothing was renumbered.

What this does

  • UserFlags gains messageEditWindow: Duration? and messageDeleteWindow: Duration?, both null in Default.
  • UserFlagsMapper maps them behind hasMessageEditWindow() / hasMessageDeleteWindow(), so an unset field stays null rather than becoming a zero-length window. That matches the hasX()-guarded convention in UserProfileMapper and ChatMetadataMapper.
  • ResolvedUserFlags exposes both as read-only ResolvedFlag<Duration?> with FieldOverride.None.
  • UserFlagsCoordinator.CachedFlags round-trips them through the offline cache. This was not optional: CachedFlags.toDomain() calls the UserFlags constructor positionally, so it would not compile otherwise. Both default to null, so previously cached JSON still deserializes.

Tests cover the mapper for both the set and absent cases, and ResolvedUserFlagsTest asserts the resolved values.

Scope

No edit or delete behaviour is wired up — this stops at getting the values into the domain layer. The debug flags UI (UserFlagsViewModel, Field.kt, strings.xml) is untouched.

flipcash2-protobuf-api added message_edit_window and message_delete_window
(Duration, explicit presence) to UserFlags. Carry both through the domain
chain: the mapper treats an unset field as null rather than a zero-length
window, matching the hasX() convention used elsewhere for optional
message-typed proto fields (UserProfileMapper, ChatMetadataMapper).

ResolvedUserFlags exposes both as read-only ResolvedFlag<Duration?> — no
FieldOverride wiring, since there's no edit/delete UI yet to exercise an
override. UserFlagsCoordinator's CachedFlags persistence gains the two
fields so the offline cache round-trips them.

No UI wiring: the debug flags screen, Field.kt, and strings.xml are
untouched pending the edit/delete feature itself.
Picks up message_edit_window and message_delete_window on UserFlags. Blocked
until 0.4.0 is published; ocp-client-protocol is unaffected and stays at 0.3.0.
@bmc08gt bmc08gt self-assigned this Sep 3, 2026
@github-actions github-actions Bot added type: feature New functionality area: network gRPC, connectivity, API, exchange rates area: build-system Gradle, convention plugins, build-logic labels Sep 3, 2026
@bmc08gt
bmc08gt marked this pull request as ready for review September 3, 2026 18:47
@bmc08gt
bmc08gt merged commit 90e165a into code/cash Sep 3, 2026
4 of 5 checks passed
bmc08gt added a commit that referenced this pull request Sep 3, 2026
Picks up #1397 (UserFlags), #1401 (restores KikCode+Badge/KikCode+Figure/
SVGPath/KikCodeFigureTests), and #1400 (FocusPin/MessageRow/
MessageReadReporter/ReceiptRules) via the true fork point as the merge
base, correcting an earlier rewrite that had reparented this branch onto
code/cash's graph without actually merging its content.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: build-system Gradle, convention plugins, build-logic area: network gRPC, connectivity, API, exchange rates type: feature New functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant