Skip to content

fix(persistence): store the viewer's can_pin permission - #1897

Merged
bmc08gt merged 2 commits into
code/cashfrom
fix/persistence-can-pin
Oct 30, 2026
Merged

bmc08gt merged 2 commits into
code/cashfrom
fix/persistence-can-pin

Conversation

@bmc08gt

@bmc08gt bmc08gt commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator

#1884 parsed ViewerState.Permissions.can_pin into canPin but never stored it, so every chat read back canPin = false from chat_metadata and no client UI could offer Pin. Found while building the pin menu (#1898): the server sent can_pin for a DM, and the row had no column for it.

  • Room 50 → 51 (AutoMigration): chat_metadata.can_pin, written and cleared alongside can_edit, can_invite and the moderation flags in ChatMetadataDao.
  • Migration50To51 resets viewer_state_version, the same way the can_edit and can_invite migrations did. Otherwise rows already at the current viewer-state version would keep can_pin = 0 until that version changes.
  • ChatEntityMapper maps the flag both ways; ChatEntityMapperTest adds a round-trip case.

#1884 parsed ViewerState.Permissions.can_pin but never saved it, so every
chat read it back as false. Add chat_metadata.can_pin (DB v51) and re-arm
viewer_state_version on upgrade, as can_edit and can_invite did.
@bmc08gt bmc08gt self-assigned this Oct 30, 2026
@github-actions github-actions Bot added the type: fix Bug fix label Oct 30, 2026
@bmc08gt
bmc08gt merged commit b0b4f41 into code/cash Oct 30, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: fix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant