command_tower 0.26.0 → 0.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/command_tower/me/inbox_controller.rb +61 -2
  3. data/app/deserializers/command_tower/deserializers/messaging/inbox.rb +12 -0
  4. data/app/errors/command_tower/errors/messaging/inbox_impersonation_forbidden_error.rb +23 -0
  5. data/app/jobs/command_tower/messaging/inbox/badge_sync_job.rb +20 -0
  6. data/app/models/command_tower/messaging/communication.rb +6 -0
  7. data/app/models/command_tower/messaging/inbox_item.rb +25 -5
  8. data/app/serializers/command_tower/serializers/messaging/inbox.rb +18 -0
  9. data/app/services/command_tower/messaging/accept/coordinator.rb +5 -2
  10. data/app/services/command_tower/messaging/accept/persister.rb +15 -0
  11. data/app/services/command_tower/messaging/accept/request_normalizer.rb +1 -0
  12. data/app/services/command_tower/messaging/accept/thread_restorer.rb +93 -0
  13. data/app/services/command_tower/messaging/contract/inbox.rb +49 -0
  14. data/app/services/command_tower/messaging/contract/requests/resolve_for_event.rb +25 -0
  15. data/app/services/command_tower/messaging/contract/results/inbox_resolution.rb +18 -0
  16. data/app/services/command_tower/messaging/execution/adapters/expo/adapter.rb +3 -0
  17. data/app/services/command_tower/messaging/inbox/badge_sync_scheduler.rb +74 -0
  18. data/app/services/command_tower/messaging/inbox/entry_result.rb +11 -2
  19. data/app/services/command_tower/messaging/inbox/impersonation_audit.rb +40 -0
  20. data/app/services/command_tower/messaging/inbox/mutator.rb +124 -18
  21. data/app/services/command_tower/messaging/inbox/operation_logger.rb +11 -0
  22. data/app/services/command_tower/messaging/inbox/reader.rb +7 -14
  23. data/app/services/command_tower/messaging/inbox/record_views_result.rb +11 -0
  24. data/app/services/command_tower/messaging/inbox/resolution_result.rb +16 -0
  25. data/app/services/command_tower/messaging/inbox.rb +16 -0
  26. data/app/services/command_tower/messaging/notification_types/declaration.rb +2 -1
  27. data/app/services/command_tower/messaging/rendering/push_presentation.rb +8 -10
  28. data/app/services/command_tower/messaging.rb +3 -1
  29. data/app/services/command_tower/services/messaging/communications/produce.rb +2 -0
  30. data/app/services/command_tower/services/messaging/inbox.rb +31 -1
  31. data/app/workflows/command_tower/workflows/messaging/error_mapping.rb +2 -1
  32. data/app/workflows/command_tower/workflows/messaging/inbox/sync_app_icon_badge_workflow.rb +99 -0
  33. data/app/workflows/command_tower/workflows/messaging/inbox.rb +70 -6
  34. data/config/routes.rb +2 -0
  35. data/db/migrate/20261127000000_add_resolved_at_to_messaging_inbox_items.rb +7 -0
  36. data/db/migrate/20261127000001_add_collapse_key_to_messaging_communications.rb +7 -0
  37. data/docs/api_reference.md +21 -6
  38. data/docs/audit.md +3 -0
  39. data/docs/messaging_integration_guide.md +20 -0
  40. data/docs/ui.md +1 -1
  41. data/docs/upgrades/0.27.0.md +65 -0
  42. data/docs/upgrades/README.md +1 -0
  43. data/lib/command_tower/authorization/default.yml +2 -0
  44. data/lib/command_tower/configuration/messaging/config.rb +6 -0
  45. data/lib/command_tower/configuration/messaging/inbox.rb +30 -0
  46. data/lib/command_tower/configuration/registry/audit/config.rb +16 -0
  47. data/lib/command_tower/install/baseline.rb +2 -0
  48. data/lib/command_tower/version.rb +1 -1
  49. metadata +16 -2
@@ -19,6 +19,18 @@ module CommandTower
19
19
 
20
20
  failure(errors: result.errors, http_status: CommandTower::Workflows::Messaging::ErrorMapping.http_status_for(result.errors.first))
21
21
  end
22
+
23
+ # Read after the mutation so the client updates its badge from the same response.
24
+ def success_with_unread_count(user:, payload:)
25
+ count_result = CommandTower::Services::Messaging::Inbox::UnreadCount.call(user:)
26
+ return result_or_failure(count_result) unless count_result.success?
27
+
28
+ success(
29
+ payload:,
30
+ meta: CommandTower::Serializers::Messaging::Inbox::UnreadCountMetaSerializer.serialize(count_result.data),
31
+ http_status: :ok
32
+ )
33
+ end
22
34
  end
23
35
 
24
36
  class ListWorkflow < BaseWorkflow
@@ -71,7 +83,9 @@ module CommandTower
71
83
 
72
84
  audit_first_view(user:, inbox_item_id:, result:) unless impersonated
73
85
 
74
- success(payload: CommandTower::Serializers::Messaging::Inbox::DetailSerializer.serialize(result.data[:item]), http_status: :ok)
86
+ success_with_unread_count(
87
+ user:, payload: CommandTower::Serializers::Messaging::Inbox::DetailSerializer.serialize(result.data[:item])
88
+ )
75
89
  end
76
90
 
77
91
  private
@@ -89,12 +103,63 @@ module CommandTower
89
103
  end
90
104
  end
91
105
 
106
+ # Scroll-read. While impersonating nothing is recorded: the skip answers before any
107
+ # id is looked at, so it never depends on the ids being valid.
108
+ class RecordViewsWorkflow < BaseWorkflow
109
+ def call(user:, inbox_item_ids:, impersonated: false)
110
+ return skipped_result(user:) if impersonated
111
+
112
+ result = CommandTower::Services::Messaging::Inbox::RecordViews.call(user:, inbox_item_ids:)
113
+ return result_or_failure(result) unless result.success?
114
+
115
+ data = result.data[:record_views]
116
+ audit_first_views(user:, newly_viewed: data[:newly_viewed])
117
+ success_with_unread_count(user:, payload: CommandTower::Serializers::Messaging::Inbox::RecordViewsSerializer.serialize(data))
118
+ end
119
+
120
+ private
121
+
122
+ def skipped_result(user:)
123
+ payload = CommandTower::Serializers::Messaging::Inbox::RecordViewsSerializer.serialize(
124
+ viewed_ids: [], unavailable_ids: [], changed_count: 0, skipped: "impersonating"
125
+ )
126
+ success_with_unread_count(user:, payload:)
127
+ end
128
+
129
+ # One event per first view, ids only (same shape as OpenWorkflow).
130
+ def audit_first_views(user:, newly_viewed:)
131
+ newly_viewed.each do |entry|
132
+ audit(
133
+ :messaging_inbox_item_viewed,
134
+ affected_user: user,
135
+ changes: {},
136
+ metadata: { inbox_item_id: entry[:id], communication_id: entry[:communication_id] }
137
+ )
138
+ end
139
+ end
140
+ end
141
+
142
+ # Marks everything unread up to the client's watermark viewed. Reversible, so it stays
143
+ # allowed while impersonating (the audit policy lands with the impersonation slice).
144
+ class MarkAllReadWorkflow < BaseWorkflow
145
+ def call(user:, up_to:)
146
+ result = CommandTower::Services::Messaging::Inbox::MarkAllRead.call(user:, up_to:)
147
+ return result_or_failure(result) unless result.success?
148
+
149
+ success_with_unread_count(
150
+ user:, payload: CommandTower::Serializers::Messaging::Inbox::BulkResultSerializer.serialize(result.data[:bulk_result])
151
+ )
152
+ end
153
+ end
154
+
92
155
  class ArchiveWorkflow < BaseWorkflow
93
156
  def call(user:, inbox_item_id:)
94
157
  result = CommandTower::Services::Messaging::Inbox::Archive.call(user:, inbox_item_id:)
95
158
  return result_or_failure(result) unless result.success?
96
159
 
97
- success(payload: CommandTower::Serializers::Messaging::Inbox::ItemSerializer.serialize(result.data[:item]), http_status: :ok)
160
+ success_with_unread_count(
161
+ user:, payload: CommandTower::Serializers::Messaging::Inbox::ItemSerializer.serialize(result.data[:item])
162
+ )
98
163
  end
99
164
  end
100
165
 
@@ -103,7 +168,7 @@ module CommandTower
103
168
  result = CommandTower::Services::Messaging::Inbox::Delete.call(user:, inbox_item_id:)
104
169
  return result_or_failure(result) unless result.success?
105
170
 
106
- success(payload: nil, http_status: :ok)
171
+ success_with_unread_count(user:, payload: nil)
107
172
  end
108
173
  end
109
174
 
@@ -123,9 +188,8 @@ module CommandTower
123
188
  result = CommandTower::Services::Messaging::Inbox.const_get(service_name).call(user:, inbox_item_ids:)
124
189
  return result_or_failure(result) unless result.success?
125
190
 
126
- success(
127
- payload: CommandTower::Serializers::Messaging::Inbox::BulkResultSerializer.serialize(result.data[:bulk_result]),
128
- http_status: :ok
191
+ success_with_unread_count(
192
+ user:, payload: CommandTower::Serializers::Messaging::Inbox::BulkResultSerializer.serialize(result.data[:bulk_result])
129
193
  )
130
194
  end
131
195
  end)
data/config/routes.rb CHANGED
@@ -75,6 +75,8 @@ CommandTower::Engine.routes.draw do
75
75
  collection do
76
76
  get :conversation
77
77
  get :unread_count, path: "unread-count"
78
+ post :views
79
+ post "mark-all-read", action: :mark_all_read
78
80
  post "bulk/read", action: :bulk_read
79
81
  post "bulk/unread", action: :bulk_unread
80
82
  post "bulk/archive", action: :bulk_archive
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ class AddResolvedAtToMessagingInboxItems < ActiveRecord::Migration[7.2]
4
+ def change
5
+ add_column :messaging_inbox_items, :resolved_at, :datetime, null: true
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ class AddCollapseKeyToMessagingCommunications < ActiveRecord::Migration[7.2]
4
+ def change
5
+ add_column :messaging_communications, :collapse_key, :string, limit: 64, null: true
6
+ end
7
+ end
@@ -403,12 +403,14 @@ Pagination for list: query `limit` (default **50**, max **100**), `offset` (defa
403
403
  | `POST` | `/me/inbox/:id/open` | Detail (+ `content`). Renders once; the first non-impersonated open marks the item viewed and emits one `messaging_inbox_item_viewed` audit event (see [audit.md](audit.md)). Impersonated opens return the detail without marking viewed or auditing. |
404
404
  | `PATCH` | `/me/inbox/:id/archive` | Item |
405
405
  | `DELETE` | `/me/inbox/:id` | `data: null` |
406
- | `GET` | `/me/inbox/unread-count` | `{ count, badgeCount }` (`badgeCount` counts only unread items of badge-eligible notification types) |
406
+ | `GET` | `/me/inbox/unread-count` | `{ count, badgeCount }`. `badgeCount` is deprecated and always equals `count`. Sends `Cache-Control: no-store`. |
407
407
  | `POST` | `/me/inbox/bulk/read` | Body `ids` (1–100 ints) → `{ ids, count, changedCount }` |
408
408
  | `POST` | `/me/inbox/bulk/unread` | same |
409
409
  | `POST` | `/me/inbox/bulk/archive` | same |
410
410
  | `POST` | `/me/inbox/bulk/restore` | same |
411
411
  | `POST` | `/me/inbox/bulk/delete` | same |
412
+ | `POST` | `/me/inbox/views` | Scroll-read. Body `ids` (1–100 ints) → `{ viewedIds, changedCount, unavailableIds }`. Marks each available item viewed in one transaction and emits one `messaging_inbox_item_viewed` audit event per first view. Missing, other-recipient and deleted ids do not fail the batch: they are returned together in `unavailableIds`, with no per-id reason. While impersonating nothing is recorded and the response is `{ viewedIds: [], changedCount: 0, unavailableIds: [], skipped: "impersonating" }`; this is decided before the body is validated. |
413
+ | `POST` | `/me/inbox/mark-all-read` | Body `upTo` (positive int) → `{ ids, count, changedCount }`. Marks viewed every live, non-archived, non-resolved unread item with `id <= upTo` in one transaction. Archived, resolved and deleted rows and rows above `upTo` are untouched, so calling it from the Archived segment is a no-op. |
412
414
 
413
415
  For a defined notification type while impersonating (or when the type is unknown), `GET /me/inbox/:id`, `POST /me/inbox/:id/open` and `GET /me/inbox/conversation` return `metadata: null`, and `content` has its `code` nodes replaced (`UI::Redaction`).
414
416
 
@@ -423,7 +425,7 @@ For a defined notification type while impersonating (or when the type is unknown
423
425
 
424
426
  Generic (default) rendering: one `paragraph` block from `communication.body` (omitted if blank — `blocks` can legitimately be `[]`), plus one `cta` block if there is a safe destination: `metadata.deep_link_path` (internal, wins when present and safe) else `metadata.deep_link` (external). Label from `metadata.cta_label`, default `"Open"`.
425
427
 
426
- **`X-UI-Catalog` request header:** accepted on every request (CommandTower reads it in the HTTP boundary). Missing or invalid values mean `1`; it changes only Inbox `content` for types registered with a `message:` MessageDefinition (catalog 2 or higher returns `ui_document`, catalog 1 returns `inbox_document_v1`); undefined types are identical for every catalog. Inbox read responses set `Cache-Control: no-store`. See [ui.md](ui.md#catalog-header).
428
+ **`X-UI-Catalog` request header:** accepted on every request (CommandTower reads it in the HTTP boundary). Missing or invalid values mean `1`; it changes only Inbox `content` for types registered with a `message:` MessageDefinition (catalog 2 or higher returns `ui_document`, catalog 1 returns `inbox_document_v1`); undefined types are identical for every catalog. Inbox read responses (list, show, open, conversation, unread-count) set `Cache-Control: no-store`. See [ui.md](ui.md#catalog-header).
427
429
 
428
430
  **`X-Time-Zone` request header:** an optional TZInfo identifier (for example `America/New_York`, at most 64 characters). The HTTP boundary reads it into `CommandTower::Current.client_time_zone`; anything else is ignored. After a 2xx response to an authenticated, non-impersonated request, CommandTower records it as the user's `last_known_timezone` column, which `GET /me` returns (as the user's shown attribute; hosts with serializer or snapshot tests will see a real value instead of null). The write happens only when the zone changed and the previous write is more than one hour old, fails open (it never changes the response), and never logs the zone. Requests made while impersonating never write. Hosts that list CORS `headers:` explicitly must add `X-Time-Zone` ([bootstrap step 11](bootstrap/11-auth-client-path.md), [cookie guide](cookie_authentication_guide.md#cors)).
429
431
 
@@ -431,13 +433,26 @@ Generic (default) rendering: one `paragraph` block from `communication.body` (om
431
433
 
432
434
  A notification type may override the document with a pure-Ruby composer (`declaration.inbox_document_composer`, called with `communication:`, returning an `InboxDocument`). Any failure (unregistered type, unresolvable class, a raising composer, a non-`InboxDocument` result) fails open to the generic document — the Inbox read path never 500s on a bad composer. The former `inbox_document.json.erb` host override is no longer read.
433
435
 
434
- **List row fields (`GET /me/inbox`):** `kind`, `id`, `title`, `preview`, `activityAt`, `createdAt`, `messageCount`, `unreadCount`, `read`, `inboxItemIds`. Item payloads (archive, `bulk` targets, conversation `messages`) use `id`, `title`, `status`, `read`, `viewedAt`, `createdAt`, `updatedAt`; conversation messages also carry the detail fields.
436
+ **List row fields (`GET /me/inbox`):** `kind`, `id`, `title`, `preview`, `activityAt`, `createdAt`, `messageCount`, `unreadCount`, `read`, `inboxItemIds`, `notificationTypeKey` (the latest message's type key, may be `null`), `unreadInboxItemIds` (ids of the row's unread members, `[]` when none). Item payloads (archive, `bulk` targets, conversation `messages`) use `id`, `title`, `status`, `read`, `viewedAt`, `createdAt`, `updatedAt`; conversation messages also carry the detail fields.
437
+
438
+ **Unread rules (two, by design):**
439
+
440
+ - **Global number** (`GET /me/inbox/unread-count` `count`, `badgeCount`, `meta.unreadCount.count`, and the push badge for every notification type): items that are not viewed, not archived, not deleted and not resolved. `badgeCount` equals `count`. The notification type declaration's `badge_eligible` is deprecated, accepted and ignored.
441
+ - **Per-row** (`unreadCount`, `read`, `unreadInboxItemIds` on list rows, and `oldest_unread` anchoring in `GET /me/inbox/conversation`): items that are not viewed, not deleted and not resolved, in both `inbox` and `archived` scopes, so an archived row reports its own unread members. These do not feed the global number.
442
+
443
+ **`meta.unreadCount` on mutations:** `POST /me/inbox/:id/open`, `PATCH /me/inbox/:id/archive`, `DELETE /me/inbox/:id`, `POST /me/inbox/views`, `POST /me/inbox/mark-all-read` and every `POST /me/inbox/bulk/*` response carry `meta: { unreadCount: { count, badgeCount } }`, the same one number as `GET /me/inbox/unread-count` read after the mutation, so a client can update its badge from the same response. The `data` shapes are unchanged.
444
+
445
+ **`upTo` is an opaque watermark.** Clients send the largest inbox item id they have loaded and must not interpret or compute it. Item ids come from an auto-increment column, so ids are not guaranteed to become visible in id order: a row with an id below `upTo` can commit after the client loaded its list, and `mark-all-read` will still mark it viewed. The watermark protects against rows newer than the loaded list in the common case, not against out-of-order commits.
435
446
 
436
447
  Hosts never expose `inboxEnabled` as a user-facing inbox switch; it appears only in the preferences contract below.
437
448
 
438
- **Errors:** `401` / `403` / `422`; show/open may return `404` `not_found`.
449
+ **Resolved items:** a host can resolve an item through the messaging contract ([messaging_integration_guide.md](messaging_integration_guide.md)). Resolved rows are excluded from `GET /me/inbox` (both `inbox` and `archived` scopes), from every unread number, and from `GET /me/inbox/conversation`; a conversation whose members are all resolved returns `404` `not_found`. `GET /me/inbox/:id` and `POST /me/inbox/:id/open` still return a resolved item.
450
+
451
+ **Impersonation policy:** `InboxController::IMPERSONATION_POLICY` lists every routed action as `passive_skip` (reads, `open`, `views`: redacted or skipped as described above), `allow_audited` (archive, mark-all-read, `bulk/read`, `bulk/unread`, `bulk/archive`, `bulk/restore`: allowed, and each request that changes rows emits one `messaging_inbox_changed_while_impersonating` audit event in the same transaction, see [audit.md](audit.md)) or `refuse`. `DELETE /me/inbox/:id` and `POST /me/inbox/bulk/delete` are refused while impersonating with `403` `inbox_impersonation_forbidden`; nothing is changed. An action missing from the policy is refused.
452
+
453
+ **Errors:** `401` / `403` (`inbox_impersonation_forbidden` for delete and bulk delete while impersonating) / `422`; show/open may return `404` `not_found`, as may `GET /me/inbox/conversation` when no member is in scope (including when all are resolved).
439
454
 
440
- **Specs:** `spec/requests/command_tower/me/inbox_spec.rb`, `me/inbox_bulk_spec.rb`.
455
+ **Specs:** `spec/requests/command_tower/me/inbox_spec.rb`, `me/inbox_bulk_spec.rb`, `me/inbox_views_spec.rb`, `me/inbox_mark_all_read_spec.rb`.
441
456
 
442
457
  ---
443
458
 
@@ -844,7 +859,7 @@ Hosts call these from **product workflows** (not as HTTP on the engine):
844
859
 
845
860
  | Service | Required kwargs |
846
861
  |---------|-----------------|
847
- | `CommandTower::Services::Messaging::Communications::Produce` | `user`, `notification_type_key`, `host_event_identity`, `title`, `body`, `platform_enabled_channels`; optional `metadata`, `conversation_key`, `conversation_title`. Fails validation when the registered type has `deep_link_required` and `metadata` has no non-blank `deep_link` |
862
+ | `CommandTower::Services::Messaging::Communications::Produce` | `user`, `notification_type_key`, `host_event_identity`, `title`, `body`, `platform_enabled_channels`; optional `metadata`, `conversation_key`, `conversation_title`, `collapse_key` (push collapse identity, sent as Expo `collapseId`; see the [messaging guide](messaging_integration_guide.md#push-collapse-key)). Fails validation when the registered type has `deep_link_required` and `metadata` has no non-blank `deep_link` |
848
863
  | `CommandTower::Services::Messaging::Communications::ProduceMany` | `user_ids`, `notification_type_key`, `campaign_identity`, `title`, `body`, `platform_enabled_channels`; optional `metadata`, `conversation_key`, `conversation_title`, `execution_mode` (`:async` default, `:sync` capped at 25) |
849
864
 
850
865
  Details: [messaging_integration_guide.md](messaging_integration_guide.md).
data/docs/audit.md CHANGED
@@ -87,6 +87,7 @@ CommandTower.config.registry.audit.set_enabled!(:login_failed, true)
87
87
  | `session_cleared` | no | yes |
88
88
  | `login_failed` | no | yes |
89
89
  | `messaging_inbox_item_viewed` | yes | yes |
90
+ | `messaging_inbox_changed_while_impersonating` | yes | no |
90
91
  | `home_notice_impression` | yes | no |
91
92
  | `home_notice_acknowledged` | yes | no |
92
93
  | `home_notice_dismissed` | yes | no |
@@ -95,6 +96,8 @@ CommandTower.config.registry.audit.set_enabled!(:login_failed, true)
95
96
 
96
97
  `messaging_inbox_item_viewed` is emitted by `Workflows::Messaging::Inbox::OpenWorkflow` once per first view of an inbox item, for every notification type (metadata: `inbox_item_id`, `communication_id`; retention `ninety_days`, not in account history). A repeat open, bulk read/unread, `Show`, and `Contract::Inbox` emit nothing. An impersonated open returns the detail but neither marks the item viewed nor audits.
97
98
 
99
+ `messaging_inbox_changed_while_impersonating` is emitted by `Messaging::Inbox::Mutator` (via `Messaging::Inbox::ImpersonationAudit`) in the same transaction as the change, once per request, when an operator archives, restores, bulk reads/unreads/archives/restores, or marks all read while impersonating (affected user: the inbox owner; admin attribution is always set; metadata `action`, `inbox_item_ids` (first 50 changed ids), `changed_count`, `up_to` (mark-all-read only) and `truncated: true` when more than 50 ids changed; no changes; retention `one_year`; not in account history). A failed audit rolls the change back. A request that changes nothing emits nothing. Delete and bulk delete are refused with 403 while impersonating, so they emit nothing. See [API reference](api_reference.md#me-inbox).
100
+
98
101
  `home_notice_impression` is emitted by `Services::HomeNotices::RecordImpression` (via `POST /me/home-notices/:id/impression`) once per first impression of a campaign period or of a delivery (affected user: the viewer; metadata `notice_id`, `key`, `kind`, `severity`; no changes; retention `ninety_days`; not in account history). The decision is an atomic write, so concurrent requests audit exactly once. A repeat impression, one inside the 60 s idempotency window, and an impersonated request emit nothing; a new campaign period audits again. See [home_notices.md](home_notices.md).
99
102
 
100
103
  `home_notice_acknowledged` is emitted by `Services::HomeNotices::Acknowledge` (via `POST /me/home-notices/:id/acknowledge`) when the request itself changes the row (subject and affected user: the user; metadata `notice_id`, `key`, `kind`, `severity`; no changes; retention `one_year`; in account history). Metadata is ids only: the content hash of a blocking acknowledgement stays on the notice row. The decision is an atomic write in the same transaction as the audit, so concurrent requests audit exactly once. A repeat acknowledge and an impersonated request (refused with 403) emit nothing.
@@ -46,6 +46,7 @@ CommandTower::Services::Messaging::Communications::Produce.call(
46
46
  | `metadata` | no (`Hash`) |
47
47
  | `conversation_key` | no (`String`) — groups inbox items into one conversation |
48
48
  | `conversation_title` | no (`String`) |
49
+ | `collapse_key` | no (`String`) — push collapse identity, see [Push collapse key](#push-collapse-key) |
49
50
 
50
51
  `Produce` fails with a validation error when the registered type declares `deep_link_required` and `metadata` has no non-blank `deep_link`.
51
52
 
@@ -98,6 +99,8 @@ The Me Inbox detail `content` field (`inbox_document_v1`, see [api_reference.md]
98
99
 
99
100
  `CommandTower::Messaging::Contract::Inbox.document_for_communication(request)` takes `Requests::DocumentForCommunication` (`communication_id:`, `recipient_id:`, `impersonating:`) and returns `Results::InboxDocument` (`communication_id`, `inbox_item_id`, `document`: the catalog 2 `UI::Document`). It returns `nil` when the communication is missing, not the recipient's, deleted or archived, not inbox-backed, or its type has no `MessageDefinition`. It is read-only and emits no audit. Home Notices use it to render a linked delivery ([home_notices.md](home_notices.md#deliver)); `viewed_for_communication?` and `mark_viewed_for_communication` are unchanged.
100
101
 
102
+ **Resolving an item.** `CommandTower::Messaging::Contract::Inbox.resolve_for_event(request)` and `unresolve_for_event(request)` take `Requests::ResolveForEvent` (`recipient_id:`, `notification_type_key:`, `host_event_identity:`; the key and identity must be non-blank, otherwise `Contract::ValidationError`) and return `Results::InboxResolution` (`communication_id`, `inbox_item_id`, `resolved`, `changed`), or `nil` when the recipient has no live inbox item for that event. Resolving sets `inbox_items.resolved_at`: a resolved item leaves the list, the unread count and the push badge, and a conversation whose members are all resolved returns `404`. The item stays readable by id (`GET /me/inbox/:id`, `POST /me/inbox/:id/open`), so an old push tap still opens it. Both calls are idempotent (`changed` is `false` on a repeat), never touch `viewed_at`, and emit no audit: the calling host owns the audit decision. Badge sync is scheduled by the scheduler, which is a no-op while impersonating.
103
+
101
104
  ## Me Inbox HTTP (summary)
102
105
 
103
106
  | Concern | Contract |
@@ -112,6 +115,23 @@ Detail `content` is `inbox_document_v1` with blocks `paragraph`, `cta` (typed `d
112
115
 
113
116
  Pagination detail: [pagination.md](pagination.md). Full catalog: [api_reference.md](api_reference.md#me-inbox).
114
117
 
118
+ ## Restoring an archived thread on a new message
119
+
120
+ `config.messaging.inbox.restore_archived_thread_on_new_message` (default `false`, so archived threads stay archived). When `true`, a genuinely new inbox item that carries a `conversation_key` restores the recipient's archived, non-deleted, non-resolved items in the same conversation. The restore runs after commit, in its own locked transaction with a deadlock retry. An idempotent replay of the same event never restores. Restoring brings back archived unread members too, so one new message can raise the unread count by more than one.
121
+
122
+ ## Badge-only push
123
+
124
+ `config.messaging.inbox.badge_sync_push` (default `false`, so no badge push is sent). When `true`, an inbox change that alters a recipient's unread count (mark read/unread, archive, restore, delete, mark-all-read, resolve/unresolve, thread restore) enqueues a silent push carrying only `{to, badge}` so the app icon badge matches the unread count. It is enqueued after commit, never while impersonating, and only when the Expo adapter is `http`. Bursts of changes are coalesced per user with a short pending marker in Redis; a change after the marker clears sends again, and the badge is read after the marker clears so it reflects the latest state. If Redis is unavailable the push is sent without coalescing. The push is best effort: failures are logged by class only and never raised. Recording views does not trigger it.
125
+
126
+ ## Push collapse key
127
+
128
+ `collapse_key` (optional `String`, on `Produce` and the Accept path) is sent to Expo as `collapseId` on the push message. It is a delivery hint: it is not part of the request fingerprint, so changing it does not make a new event.
129
+
130
+ - Format: starts with a letter or digit, then letters, digits, `.`, `_`, `:` or `-`; 64 characters at most. Anything else fails validation. Blank is stored as `nil`.
131
+ - It is never derived from `conversation_key`. A conversation outlives any one notification, so the producer chooses the key per notification that should replace another.
132
+ - iOS replaces an earlier delivered notification that has the same `collapseId`. Android collapse behaviour is governed by the Expo/FCM collapse rules and not guaranteed to replace a notification already shown; do not rely on it for correctness.
133
+ - Shared-key warning: every push with the same key collapses into one, across types and conversations, for that device. Namespace the key (for example `<type>:<entity_id>`) and never reuse one key for unrelated notifications, or one will silently replace the other.
134
+
115
135
  ## Email compliance (defined types)
116
136
 
117
137
  Emails for types registered with a `message:` MessageDefinition carry a compliance footer and, when eligible, RFC 8058 one-click unsubscribe headers. Undefined types get neither (their ERB templates are unchanged).
data/docs/ui.md CHANGED
@@ -199,7 +199,7 @@ Mailer previews for defined types: `/rails/mailers/message_definition/sample_ema
199
199
 
200
200
  Clients send `X-UI-Catalog: <n>`. `UI::Catalog.from_header` returns `1` for a missing, blank, non-integer or non-positive value and clamps higher numbers to `UI::CATALOG` (currently `2`). `HttpBoundary` passes the result into `with_execution`, and it is available as `CommandTower::Current.ui_catalog` (default `1`; nested `with_execution` keeps the outer value).
201
201
 
202
- It changes only Inbox read responses for types registered with a `message:` MessageDefinition: catalog 2 or higher returns the validated `UI::Document` (`ui_document`), catalog 1 returns `inbox_document_v1` through `UI::LegacyMapping`. Undefined types return the same `inbox_document_v1` for every catalog. The header is never read for authorization. Inbox read responses (list, show, open, conversation) set `Cache-Control: no-store`.
202
+ It changes only Inbox read responses for types registered with a `message:` MessageDefinition: catalog 2 or higher returns the validated `UI::Document` (`ui_document`), catalog 1 returns `inbox_document_v1` through `UI::LegacyMapping`. Undefined types return the same `inbox_document_v1` for every catalog. The header is never read for authorization. Inbox read responses (list, show, open, conversation, unread-count) set `Cache-Control: no-store`.
203
203
 
204
204
  Push, SMS and Pushover for defined types are built from the slots stored at Accept (`headline`, `push_body`, `sms_body`, `pushover_title`, `pushover_message`), not from the catalog; undefined types keep the generic templates.
205
205
 
@@ -0,0 +1,65 @@
1
+ # Upgrade: CommandTower 0.27.0
2
+
3
+ **From:** `0.26.0`
4
+ **To:** `0.27.0`
5
+
6
+ Minor release: inbox lifecycle and freshness. The platform now has one unread number everywhere, every inbox mutation returns the server count, reminders can resolve themselves, impersonation is audited and delete is refused, and push gains an optional collapse key and an optional badge-only sync. Everything is additive: two new columns, new endpoints, new options that default to today's behaviour. Contract: [API reference](../api_reference.md#me-inbox) and the [messaging guide](../messaging_integration_guide.md).
7
+
8
+ ## Migrations (required)
9
+
10
+ Two additive migrations. Hosts must install and run them before the new code serves traffic:
11
+
12
+ ```bash
13
+ bin/rails command_tower:install:migrations
14
+ bin/rails db:migrate
15
+ ```
16
+
17
+ | Migration | Change |
18
+ |-----------|--------|
19
+ | `20261127000000_add_resolved_at_to_messaging_inbox_items.rb` | `messaging_inbox_items.resolved_at` (nullable, no index) |
20
+ | `20261127000001_add_collapse_key_to_messaging_communications.rb` | `messaging_communications.collapse_key` (string, limit 64, nullable) |
21
+
22
+ Both are in the install baseline (`ENGINE_MIGRATION_BASENAMES`), so the doctor reports a host that has not copied them.
23
+
24
+ **What breaks without them:** inbox reads, counts and mutations select `resolved_at`, so every `/me/inbox*` request fails with a database error (`500`) once the new code runs against the old schema; producing or accepting a communication writes `collapse_key` and fails the same way. Run the migrations in the same deploy as the bump, and migrate before new nodes take traffic (see Rolling deploy).
25
+
26
+ ## Host-visible changes
27
+
28
+ | Change | Host impact |
29
+ |--------|-------------|
30
+ | One number rule | `badgeCount` always equals `count`, and the push `badge` is the same number for every notification type. Consequence for the iOS app icon: a type declared `badge_eligible: false` used to stay out of the icon number; it now counts, so the icon can show a higher number than before. |
31
+ | `badge_eligible` deprecation | The keyword on a notification type declaration is still accepted and is ignored. It will be removed in a future major release, once no host passes it. Remove it from your declarations when convenient. |
32
+ | Global unread rule | The global count, the push badge and mark-all-read count items that are not viewed, not archived, not deleted and not resolved (`counts_as_unread`). |
33
+ | List and thread unread rule | `InboxItem.unread_in_scope`: list rows and conversation entries count unread within the list scope (Inbox or Archived). A row can be unread in Archived without counting toward the global number. List rows add `notificationTypeKey` and `unreadInboxItemIds`. |
34
+ | Resolve | `Messaging::Contract::Inbox.resolve_for_event` / `unresolve_for_event` set or clear `resolved_at` per recipient. A resolved item leaves the list, the count, the badge and unread paths, and a conversation whose members are all resolved returns `404`. Show and open still work by id. Hosts decide when to call it; the engine never parses `host_event_identity`. |
35
+ | `meta.unreadCount` | `{ count, badgeCount }` on open, archive, delete, views, mark-all-read and every `bulk/*` response. `data` shapes are unchanged. |
36
+ | New endpoints | `POST /me/inbox/views` (passive scroll-read, batch of 1 to 100 ids) and `POST /me/inbox/mark-all-read` (`upTo` watermark). |
37
+ | `no-store` | `GET /me/inbox/unread-count` sends `Cache-Control: no-store`. There is no ETag or 304 on it. |
38
+ | Delete under impersonation | `DELETE /me/inbox/:id` and `POST /me/inbox/bulk/delete` return `403` `inbox_impersonation_forbidden` while impersonating. Clients that call delete during impersonation must handle it. |
39
+ | Impersonation audit | Archive, restore, `bulk/read`, `bulk/unread`, `bulk/archive`, `bulk/restore` and mark-all-read are allowed while impersonating and emit one `messaging_inbox_changed_while_impersonating` event per request, in the same transaction as the change (retention one year, ids-only metadata, not in account history). Views record nothing while impersonating and answer `skipped: "impersonating"`. See [Audit](../audit.md). |
40
+ | `config.messaging.inbox.restore_archived_thread_on_new_message` | Default `false` (archived threads stay archived). When `true`, a new message with a `conversation_key` restores the recipient's archived, non-deleted, non-resolved items in that conversation. Restoring brings back archived unread members, so one new message can raise the badge by more than one. |
41
+ | `config.messaging.inbox.badge_sync_push` | Default `false` (no push is sent). When `true`, a count-changing inbox action enqueues a silent badge-only push (`{to, badge}`) after commit, never while impersonating. Needs the Expo `http` adapter. Delivery on a device is an owner device check; do not enable it on a host until that check passes. |
42
+ | `collapse_key:` on Produce and Accept | Optional, 64 characters at most, sent to Expo as `collapseId`. Not fingerprinted and never derived from `conversation_key`. iOS replaces a delivered notification with the same key; Android behaviour follows Expo/FCM and is not guaranteed. **Shared-key warning:** every push with the same key collapses into one on that device, across types and conversations. Namespace keys (for example `<type>:<entity_id>`) and never share a key between unrelated notifications. See [Push collapse key](../messaging_integration_guide.md#push-collapse-key). |
43
+
44
+ ## Host actions
45
+
46
+ 1. Bump the gem to `0.27.0` (or `>= 0.27.0`) and run `bundle install`.
47
+ 2. Run `command_tower:install:migrations` and `db:migrate` (above), commit the copied migrations and the schema change.
48
+ 3. Nothing else is required: with no new options set, a host behaves as on 0.26.0 apart from the one-number rule and the `meta` / `no-store` additions.
49
+ 4. Optional, by host choice: call resolve/unresolve for self-clearing reminders, set `collapse_key` where a newer push should replace an older one, set `restore_archived_thread_on_new_message`, set `badge_sync_push` after the device check.
50
+ 5. Clients: `@commandtower/frontend` `0.7.0` is the paired release. It reads `meta.unreadCount`, calls `views` and `mark-all-read`, and falls back to per-item open and a hidden Mark all read when the engine answers `404` (an engine older than 0.27.0). It installs a single app `focusManager` for refresh on focus and the 15 s unread poll; a host that registers its own React Query `focusManager` handler should drop it. Pair the client release with this engine release.
51
+
52
+ ## DoubleFloor Me pin advice
53
+
54
+ DoubleFloor Me keeps its gem pin at `~> 0.26.0` until its own bump to `0.27.0` is planned and its owner device checks and migrations are in hand. Pin it before this release is pushed to the gem index, so a routine `bundle update` cannot pull `0.27.0` into DFM without its migrations. Pick'em and DFM bumps are host work and ship after this release (platform release first, then host bump).
55
+
56
+ ## Rolling deploy
57
+
58
+ Run the migrations before new nodes take traffic. The columns are nullable and additive, so old nodes keep working against the migrated schema; new nodes against the old schema fail (see Migrations). Behaviour options default to off, so mixed fleets agree until a host flips one.
59
+
60
+ ## Not in this release
61
+
62
+ - No ETag or `304` on `GET /me/inbox/unread-count`; it sends `no-store`.
63
+ - No batch resolve, and no host sweep or backfill of `resolved_at`.
64
+ - No `PATCH /me/inbox/:id/restore`; `POST /me/inbox/bulk/restore` with one id covers it.
65
+ - No change to authentication, sessions, CSRF or RBAC.
@@ -4,6 +4,7 @@ Host-facing upgrade / change summaries for CommandTower releases.
4
4
 
5
5
  | Version | Summary |
6
6
  |---------|---------|
7
+ | [0.27.0](0.27.0.md) | Inbox lifecycle and freshness: one unread number (`badge_eligible` deprecated), `resolved_at` resolve contract, `meta.unreadCount` on mutations, `views` and `mark-all-read`, `no-store` unread-count, delete 403 and audit under impersonation, thread restore and badge-only push options (off by default), push `collapse_key`; two additive migrations (`install:migrations` + `db:migrate` required) |
7
8
  | [0.26.0](0.26.0.md) | Experience-states hardening: host key registry (register before bumping), complete rate limit and per-user cap, refused while impersonating, audit metadata and one-year retention; no migration |
8
9
  | [0.25.0](0.25.0.md) (draft) | Device sessions: `command_tower_device_sessions` migration, `config.session.*`, `sid` token claim, `session_expired` / `session_revoked` 401 codes |
9
10
  | [0.24.0](0.24.0.md) | Home Notices: `Campaign` / `Delivery` notices (blocking or dismissible), `command_tower_home_notices` and `command_tower_home_notice_controls` migrations, `config.home_notices`, `me_home_notices` / `admin_home_notices_kill` RBAC |
@@ -44,6 +44,8 @@ entities:
44
44
  - archive
45
45
  - destroy
46
46
  - unread_count
47
+ - views
48
+ - mark_all_read
47
49
  - bulk_read
48
50
  - bulk_unread
49
51
  - bulk_archive
@@ -5,6 +5,7 @@ require "command_tower/configuration/messaging/sms"
5
5
  require "command_tower/configuration/messaging/pushover"
6
6
  require "command_tower/configuration/messaging/expo"
7
7
  require "command_tower/configuration/messaging/compliance"
8
+ require "command_tower/configuration/messaging/inbox"
8
9
 
9
10
  module CommandTower
10
11
  module Configuration
@@ -78,6 +79,11 @@ module CommandTower
78
79
  allowed: Compliance,
79
80
  default: Compliance.new
80
81
 
82
+ add_composer :inbox,
83
+ desc: "Inbox behaviour configuration (thread restore on a new message)",
84
+ allowed: Inbox,
85
+ default: Inbox.new
86
+
81
87
  add_composer :strict_definitions,
82
88
  desc: "When true, MessageDefinition violations (metadata schema, explicit copy on a defined " \
83
89
  "type) fail the request; when false they are logged and degraded. Default true in " \
@@ -0,0 +1,30 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "class_composer"
4
+
5
+ module CommandTower
6
+ module Configuration
7
+ module Messaging
8
+ class Inbox < ::CommandTower::Configuration::Base
9
+ include ClassComposer::Generator
10
+
11
+ add_composer :restore_archived_thread_on_new_message,
12
+ desc: "When true, a genuinely new inbox item that carries a conversation_key restores the " \
13
+ "recipient's archived, non-deleted, non-resolved items in the same conversation " \
14
+ "(after commit). Idempotent replays never restore. Restoring brings back archived " \
15
+ "unread members, so one new message can raise the unread count by more than one. " \
16
+ "Default false (archived threads stay archived).",
17
+ allowed: [TrueClass, FalseClass],
18
+ default: false
19
+
20
+ add_composer :badge_sync_push,
21
+ desc: "When true, an inbox change that alters a recipient's unread count (mark read/unread, " \
22
+ "archive, restore, delete, mark-all-read, resolve/unresolve, thread restore) enqueues a " \
23
+ "silent, badge-only push that sets the app icon badge. Never sent while impersonating. " \
24
+ "Default false (no badge push).",
25
+ allowed: [TrueClass, FalseClass],
26
+ default: false
27
+ end
28
+ end
29
+ end
30
+ end
@@ -318,6 +318,22 @@ module CommandTower
318
318
  subject_required: false,
319
319
  affected_user_required: true
320
320
  },
321
+ # An operator changed a recipient's inbox while impersonating (archive, restore, bulk
322
+ # actions, mark all read). Metadata is ids only, capped, with a `truncated` flag. Not shown
323
+ # in the end user's history.
324
+ messaging_inbox_changed_while_impersonating: {
325
+ label: "Inbox changed while impersonating",
326
+ tags: %w[messaging inbox impersonation],
327
+ enabled: true,
328
+ enablement_configurable: false,
329
+ user_history: false,
330
+ sensitive_fields: [],
331
+ allowed_changes: [],
332
+ retention: :one_year,
333
+ subject_required: false,
334
+ affected_user_required: true,
335
+ global_visible_in_host_scope: true
336
+ },
321
337
  experience_state_completed: {
322
338
  label: "Experience state completed",
323
339
  tags: %w[experience account],
@@ -25,6 +25,8 @@ module CommandTower
25
25
  20261124000003_create_command_tower_device_sessions.rb
26
26
  20261124200001_create_command_tower_home_notices.rb
27
27
  20261124200002_create_command_tower_home_notice_controls.rb
28
+ 20261127000000_add_resolved_at_to_messaging_inbox_items.rb
29
+ 20261127000001_add_collapse_key_to_messaging_communications.rb
28
30
  ].freeze
29
31
 
30
32
  module_function
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CommandTower
4
- VERSION = "0.26.0"
4
+ VERSION = "0.27.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: command_tower
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.26.0
4
+ version: 0.27.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - matt-taylor
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-11-26 00:00:00.000000000 Z
11
+ date: 2026-11-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: phonelib
@@ -375,6 +375,7 @@ files:
375
375
  - app/errors/command_tower/errors/messaging/gallery_test_send_impersonating_error.rb
376
376
  - app/errors/command_tower/errors/messaging/gallery_test_send_rate_limit_error.rb
377
377
  - app/errors/command_tower/errors/messaging/idempotency_conflict_error.rb
378
+ - app/errors/command_tower/errors/messaging/inbox_impersonation_forbidden_error.rb
378
379
  - app/errors/command_tower/errors/messaging/recipient_unresolved_error.rb
379
380
  - app/errors/command_tower/errors/messaging/unsubscribe_rate_limit_error.rb
380
381
  - app/errors/command_tower/errors/not_found_error.rb
@@ -392,6 +393,7 @@ files:
392
393
  - app/jobs/command_tower/messaging/execution_recovery_job.rb
393
394
  - app/jobs/command_tower/messaging/handoff_job.rb
394
395
  - app/jobs/command_tower/messaging/handoff_recovery_job.rb
396
+ - app/jobs/command_tower/messaging/inbox/badge_sync_job.rb
395
397
  - app/mailers/command_tower/application_mailer.rb
396
398
  - app/mailers/command_tower/email_verification_mailer.rb
397
399
  - app/mailers/command_tower/messaging/channel_mailer.rb
@@ -523,6 +525,7 @@ files:
523
525
  - app/services/command_tower/messaging/accept/request_normalizer.rb
524
526
  - app/services/command_tower/messaging/accept/resolve_communication_slots.rb
525
527
  - app/services/command_tower/messaging/accept/result.rb
528
+ - app/services/command_tower/messaging/accept/thread_restorer.rb
526
529
  - app/services/command_tower/messaging/accept/unknown_type_error.rb
527
530
  - app/services/command_tower/messaging/accept/validation_error.rb
528
531
  - app/services/command_tower/messaging/announcement_definition.rb
@@ -548,6 +551,7 @@ files:
548
551
  - app/services/command_tower/messaging/contract/requests/document_for_communication.rb
549
552
  - app/services/command_tower/messaging/contract/requests/find_communication.rb
550
553
  - app/services/command_tower/messaging/contract/requests/mark_viewed_for_communication.rb
554
+ - app/services/command_tower/messaging/contract/requests/resolve_for_event.rb
551
555
  - app/services/command_tower/messaging/contract/requests/viewed_for_communication.rb
552
556
  - app/services/command_tower/messaging/contract/results/channel_delivery_result.rb
553
557
  - app/services/command_tower/messaging/contract/results/communication_result.rb
@@ -555,6 +559,7 @@ files:
555
559
  - app/services/command_tower/messaging/contract/results/destination_plan_result.rb
556
560
  - app/services/command_tower/messaging/contract/results/inbox_document.rb
557
561
  - app/services/command_tower/messaging/contract/results/inbox_item_result.rb
562
+ - app/services/command_tower/messaging/contract/results/inbox_resolution.rb
558
563
  - app/services/command_tower/messaging/contract/results/inbox_view_mark.rb
559
564
  - app/services/command_tower/messaging/contract/validation_error.rb
560
565
  - app/services/command_tower/messaging/definitions/document_builder.rb
@@ -621,10 +626,12 @@ files:
621
626
  - app/services/command_tower/messaging/handoff/operation_logger.rb
622
627
  - app/services/command_tower/messaging/handoff/recovery.rb
623
628
  - app/services/command_tower/messaging/inbox.rb
629
+ - app/services/command_tower/messaging/inbox/badge_sync_scheduler.rb
624
630
  - app/services/command_tower/messaging/inbox/bulk_result.rb
625
631
  - app/services/command_tower/messaging/inbox/conversation_result.rb
626
632
  - app/services/command_tower/messaging/inbox/entry_result.rb
627
633
  - app/services/command_tower/messaging/inbox/error.rb
634
+ - app/services/command_tower/messaging/inbox/impersonation_audit.rb
628
635
  - app/services/command_tower/messaging/inbox/invalid_bulk_items_error.rb
629
636
  - app/services/command_tower/messaging/inbox/invariant_error.rb
630
637
  - app/services/command_tower/messaging/inbox/item_result.rb
@@ -633,6 +640,8 @@ files:
633
640
  - app/services/command_tower/messaging/inbox/not_found_error.rb
634
641
  - app/services/command_tower/messaging/inbox/operation_logger.rb
635
642
  - app/services/command_tower/messaging/inbox/reader.rb
643
+ - app/services/command_tower/messaging/inbox/record_views_result.rb
644
+ - app/services/command_tower/messaging/inbox/resolution_result.rb
636
645
  - app/services/command_tower/messaging/inbox/scope.rb
637
646
  - app/services/command_tower/messaging/inbox/unread_count_result.rb
638
647
  - app/services/command_tower/messaging/inbox/validation_error.rb
@@ -964,6 +973,7 @@ files:
964
973
  - app/workflows/command_tower/workflows/messaging/execution/deliver_workflow.rb
965
974
  - app/workflows/command_tower/workflows/messaging/handoff/process_workflow.rb
966
975
  - app/workflows/command_tower/workflows/messaging/inbox.rb
976
+ - app/workflows/command_tower/workflows/messaging/inbox/sync_app_icon_badge_workflow.rb
967
977
  - app/workflows/command_tower/workflows/messaging/preferences/show_workflow.rb
968
978
  - app/workflows/command_tower/workflows/messaging/preferences/update_workflow.rb
969
979
  - app/workflows/command_tower/workflows/messaging/unsubscribe/one_click_workflow.rb
@@ -990,6 +1000,8 @@ files:
990
1000
  - db/migrate/20261124000003_create_command_tower_device_sessions.rb
991
1001
  - db/migrate/20261124200001_create_command_tower_home_notices.rb
992
1002
  - db/migrate/20261124200002_create_command_tower_home_notice_controls.rb
1003
+ - db/migrate/20261127000000_add_resolved_at_to_messaging_inbox_items.rb
1004
+ - db/migrate/20261127000001_add_collapse_key_to_messaging_communications.rb
993
1005
  - docs/admin_workspace.md
994
1006
  - docs/api_reference.md
995
1007
  - docs/architecture.md
@@ -1049,6 +1061,7 @@ files:
1049
1061
  - docs/upgrades/0.24.0.md
1050
1062
  - docs/upgrades/0.25.0.md
1051
1063
  - docs/upgrades/0.26.0.md
1064
+ - docs/upgrades/0.27.0.md
1052
1065
  - docs/upgrades/README.md
1053
1066
  - lib/command_tower.rb
1054
1067
  - lib/command_tower/admin_scope.rb
@@ -1102,6 +1115,7 @@ files:
1102
1115
  - lib/command_tower/configuration/messaging/compliance.rb
1103
1116
  - lib/command_tower/configuration/messaging/config.rb
1104
1117
  - lib/command_tower/configuration/messaging/expo.rb
1118
+ - lib/command_tower/configuration/messaging/inbox.rb
1105
1119
  - lib/command_tower/configuration/messaging/pushover.rb
1106
1120
  - lib/command_tower/configuration/messaging/sms.rb
1107
1121
  - lib/command_tower/configuration/otp/config.rb