feat(flipcash): thread message edit/delete windows through UserFlags - #1397
Merged
Conversation
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
marked this pull request as ready for review
September 3, 2026 18:47
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.
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.
Threads the two new
UserFlagsdurations 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.0is 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 reportscom.flipcash:flipcash2-client-protocol:0.4.0 FAILEDat resolution.The scaffolding was developed and tested against the client checkout directly, via
protoLocalRootinlocal.properties. CI never sees that override —local.propertiesis untracked — 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 nothing was renumbered.
What this does
UserFlagsgainsmessageEditWindow: Duration?andmessageDeleteWindow: Duration?, bothnullinDefault.UserFlagsMappermaps them behindhasMessageEditWindow()/hasMessageDeleteWindow(), so an unset field staysnullrather than becoming a zero-length window. That matches thehasX()-guarded convention inUserProfileMapperandChatMetadataMapper.ResolvedUserFlagsexposes both as read-onlyResolvedFlag<Duration?>withFieldOverride.None.UserFlagsCoordinator.CachedFlagsround-trips them through the offline cache. This was not optional:CachedFlags.toDomain()calls theUserFlagsconstructor positionally, so it would not compile otherwise. Both default tonull, so previously cached JSON still deserializes.Tests cover the mapper for both the set and absent cases, and
ResolvedUserFlagsTestasserts 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.