Skip to content

feat(group): edit join and chat balance requirements from Edit Group - #1017

Merged
bmc08gt merged 5 commits into
mainfrom
feat/group-balance-requirement-edit
Oct 29, 2026
Merged

bmc08gt merged 5 commits into
mainfrom
feat/group-balance-requirement-edit

Conversation

@bmc08gt

@bmc08gt bmc08gt commented Oct 7, 2026 •

Copy link
Copy Markdown
Collaborator

The Join and Chat rows under Balance Requirements in Edit Group open the same amount entry screen Minimum To Chat uses, and Save now changes the group's rules through EditChat (EditChatRequest.rules, flipcash2-client-protocol 0.23.0). Depends on #1157 for the 0.23.0 scaffolding.

What the server accepts

EditChat replaces the whole rule set and accepts less than the earlier stub assumed, so the editor now follows the contract:

  • The card shows only on a public group created with a Join minimum. A private group is denied and any other group is invalid, so a requirement can't be added where there is none, and the Join requirement can't be removed.
  • Entry is converted into the Join requirement's currency and rounded to its smallest unit. A Chat requirement copies the Join requirement's currency and mints.
  • A Chat amount at or below Join is blocked before sending ("Chat Minimum Too Low"). Raising Join to or above an existing Chat amount is blocked with the invalid-rules alert.
  • The Chat editor has a trash button in its toolbar that takes the group back to no separate Chat requirement. Without one, the Chat row shows the Join minimum, as the group profile does.
  • The creator has to meet the new rules, Chat included. That's checked before sending when the balance and rate are known, and otherwise left to the server.
  • Unchanged amounts keep Save disabled.
  • Rules the app doesn't model (staff, creator) go back as the server sent them. ConversationRules keeps the serialized proto it was decoded from, and ConversationRulesEdit edits that, because ConversationRules(proto) drops rules it doesn't recognise. Database.schemaVersion is 61 for the new field.

ErrorEditChat.invalidRules and .rulesNotSatisfied map to "This Requirement Isn't Valid" and "You Don't Meet This Requirement". The .unavailable path and "Not Available Yet" are gone.

Members follow a change live

applyEdit seats the returned rules, and the stream's RulesChanged already lands in the store, so the gates and profile rows that read the stored conversation update without a reopen. Three gaps closed:

  • A member below the Join minimum now gets the read-only state a falling balance produces, keeping the transcript. Before, they got the blocked, blurred state. Rule changes never remove a member.
  • Group link cards overlay the stored rules on their fetched copy.
  • Reopening a group the viewer has left refetches its rules, so a rejoin is weighed against the current rules.

A RulesChanged whose Join requirement uses a currency this client can't decode is ignored, keeping the old gate. Applying it would turn a gated group ungated, and a refetch decodes the same way.

@bmc08gt bmc08gt self-assigned this Oct 7, 2026
The Join and Chat rows in Edit Group now open the amount entry screen,
and the card shows on groups with no requirement so one can be added.

Saving is stubbed: flipcash2-client-protocol 0.18.0 has no RPC that
changes a group's rules after StartChat (EditChatRequest carries only
title, description and pictures). SessionGroupChatEditor.setMinimumBalance
throws .unavailable, which shows "Not Available Yet" and isn't reported.
That method body is the one place to wire the RPC when it lands.
A member short of the listener minimum keeps reading and can't speak,
as when their balance falls, instead of losing the transcript. Group
link cards read the stored rules, and reopening a group the viewer has
left refetches its rules so a rejoin is weighed against them.
@bmc08gt
bmc08gt force-pushed the feat/group-balance-requirement-edit branch from cedbe69 to 43a4651 Compare October 29, 2026 12:08
@bmc08gt
bmc08gt merged commit 5195f54 into main Oct 29, 2026
4 checks 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