Commit 4b7661e
authored
feat(ios): durable offline command outbox for chat sends (#100331)
* feat(ios): durable offline command outbox for chat sends
Text messages sent while the gateway is unreachable queue in a durable
per-gateway outbox (new outbox_commands table in the per-gateway chat
cache SQLite store, schema v2) instead of failing. Queued bubbles render
with visible Queued/Sending/Not sent states and flush strictly in
createdAt order once transport health recovers; each command's client
UUID rides as the send idempotency key, so at-least-once delivery plus
gateway dedupe keeps the transcript exact.
Contract summary:
- Bounds: 50 queued commands per gateway; refused enqueues keep the
draft. Queued rows older than 48h expire to failed("expired") rather
than silently sending stale commands; tap-to-retry refreshes
createdAt so an expired row can resend as new intent.
- Failure taxonomy: transport-level failures keep rows queued without
burning retry attempts (backoff ladder, then health drops so the
reconnect machinery owns pacing); gateway rejections burn attempts
and fail terminally after 3, with context-menu retry/delete.
- Deletes are tombstoned synchronously and rechecked after the claim
await so an active flush can never send a removed command; Delete is
hidden while a bubble is already in flight; offline enqueue is
guarded against double submit during the health probe.
- Post-reconnect live sends route behind draining outbox rows (FIFO),
and a cold open assumes a backlog until restore adopts durable rows.
- Crash safety: 'sending' rows revert to 'queued' at startup; flushed
turns are spliced into the session's cached transcript before their
outbox row is deleted, and stale history snapshots cannot evict a
just-flushed turn until a snapshot confirms it.
- Per-gateway scoping and purge ride the transcript cache: one SQLite
file per gateway; reset/forget drops the queue with the cache.
Fixture/unpaired transports get no outbox.
Part of #46664
* chore(ios): sync native i18n inventory
* style(chat-ui): satisfy strict SwiftFormat lint (doc comment, scope blank line)1 parent 0d509ab commit 4b7661e
13 files changed
Lines changed: 2559 additions & 271 deletions
File tree
- apps
- .i18n
- ios/Sources
- Design
- Model
- docs/platforms
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7299 | 7299 | | |
7300 | 7300 | | |
7301 | 7301 | | |
7302 | | - | |
| 7302 | + | |
7303 | 7303 | | |
7304 | 7304 | | |
7305 | 7305 | | |
7306 | 7306 | | |
7307 | 7307 | | |
7308 | 7308 | | |
7309 | 7309 | | |
7310 | | - | |
| 7310 | + | |
7311 | 7311 | | |
7312 | 7312 | | |
7313 | 7313 | | |
7314 | 7314 | | |
7315 | 7315 | | |
7316 | 7316 | | |
7317 | 7317 | | |
7318 | | - | |
| 7318 | + | |
7319 | 7319 | | |
7320 | 7320 | | |
7321 | 7321 | | |
7322 | 7322 | | |
7323 | 7323 | | |
7324 | 7324 | | |
7325 | 7325 | | |
7326 | | - | |
| 7326 | + | |
7327 | 7327 | | |
7328 | 7328 | | |
7329 | 7329 | | |
7330 | 7330 | | |
7331 | 7331 | | |
7332 | 7332 | | |
7333 | 7333 | | |
7334 | | - | |
| 7334 | + | |
7335 | 7335 | | |
7336 | 7336 | | |
7337 | 7337 | | |
7338 | 7338 | | |
7339 | 7339 | | |
7340 | 7340 | | |
7341 | 7341 | | |
7342 | | - | |
| 7342 | + | |
7343 | 7343 | | |
7344 | 7344 | | |
7345 | 7345 | | |
7346 | 7346 | | |
7347 | 7347 | | |
7348 | 7348 | | |
7349 | 7349 | | |
7350 | | - | |
| 7350 | + | |
7351 | 7351 | | |
7352 | 7352 | | |
7353 | 7353 | | |
7354 | 7354 | | |
7355 | 7355 | | |
7356 | 7356 | | |
7357 | 7357 | | |
7358 | | - | |
| 7358 | + | |
7359 | 7359 | | |
7360 | 7360 | | |
7361 | 7361 | | |
7362 | 7362 | | |
7363 | 7363 | | |
7364 | 7364 | | |
7365 | 7365 | | |
7366 | | - | |
| 7366 | + | |
7367 | 7367 | | |
7368 | 7368 | | |
7369 | 7369 | | |
7370 | 7370 | | |
7371 | 7371 | | |
7372 | 7372 | | |
7373 | 7373 | | |
7374 | | - | |
| 7374 | + | |
7375 | 7375 | | |
7376 | 7376 | | |
7377 | 7377 | | |
7378 | 7378 | | |
7379 | 7379 | | |
7380 | 7380 | | |
7381 | 7381 | | |
7382 | | - | |
| 7382 | + | |
7383 | 7383 | | |
7384 | 7384 | | |
7385 | 7385 | | |
7386 | 7386 | | |
7387 | 7387 | | |
7388 | 7388 | | |
7389 | 7389 | | |
7390 | | - | |
| 7390 | + | |
7391 | 7391 | | |
7392 | 7392 | | |
7393 | 7393 | | |
7394 | 7394 | | |
7395 | 7395 | | |
7396 | 7396 | | |
7397 | 7397 | | |
7398 | | - | |
| 7398 | + | |
7399 | 7399 | | |
7400 | 7400 | | |
7401 | 7401 | | |
| |||
11195 | 11195 | | |
11196 | 11196 | | |
11197 | 11197 | | |
11198 | | - | |
| 11198 | + | |
11199 | 11199 | | |
11200 | 11200 | | |
11201 | 11201 | | |
11202 | 11202 | | |
11203 | 11203 | | |
11204 | 11204 | | |
11205 | 11205 | | |
11206 | | - | |
| 11206 | + | |
11207 | 11207 | | |
11208 | 11208 | | |
11209 | 11209 | | |
11210 | 11210 | | |
11211 | 11211 | | |
11212 | 11212 | | |
11213 | 11213 | | |
11214 | | - | |
| 11214 | + | |
11215 | 11215 | | |
11216 | 11216 | | |
11217 | 11217 | | |
11218 | 11218 | | |
11219 | 11219 | | |
11220 | 11220 | | |
11221 | 11221 | | |
11222 | | - | |
| 11222 | + | |
11223 | 11223 | | |
11224 | 11224 | | |
11225 | 11225 | | |
11226 | 11226 | | |
11227 | 11227 | | |
11228 | 11228 | | |
11229 | 11229 | | |
11230 | | - | |
| 11230 | + | |
11231 | 11231 | | |
11232 | 11232 | | |
11233 | 11233 | | |
11234 | 11234 | | |
11235 | 11235 | | |
11236 | 11236 | | |
11237 | 11237 | | |
11238 | | - | |
| 11238 | + | |
11239 | 11239 | | |
11240 | 11240 | | |
11241 | 11241 | | |
11242 | 11242 | | |
11243 | 11243 | | |
11244 | 11244 | | |
11245 | 11245 | | |
11246 | | - | |
| 11246 | + | |
11247 | 11247 | | |
11248 | 11248 | | |
11249 | 11249 | | |
11250 | 11250 | | |
11251 | 11251 | | |
11252 | 11252 | | |
11253 | 11253 | | |
11254 | | - | |
| 11254 | + | |
11255 | 11255 | | |
11256 | 11256 | | |
11257 | 11257 | | |
| |||
20361 | 20361 | | |
20362 | 20362 | | |
20363 | 20363 | | |
| 20364 | + | |
| 20365 | + | |
| 20366 | + | |
| 20367 | + | |
| 20368 | + | |
| 20369 | + | |
| 20370 | + | |
| 20371 | + | |
| 20372 | + | |
| 20373 | + | |
| 20374 | + | |
| 20375 | + | |
| 20376 | + | |
| 20377 | + | |
| 20378 | + | |
| 20379 | + | |
| 20380 | + | |
| 20381 | + | |
| 20382 | + | |
| 20383 | + | |
| 20384 | + | |
| 20385 | + | |
| 20386 | + | |
| 20387 | + | |
| 20388 | + | |
| 20389 | + | |
| 20390 | + | |
| 20391 | + | |
| 20392 | + | |
| 20393 | + | |
| 20394 | + | |
| 20395 | + | |
| 20396 | + | |
| 20397 | + | |
| 20398 | + | |
| 20399 | + | |
| 20400 | + | |
| 20401 | + | |
| 20402 | + | |
| 20403 | + | |
| 20404 | + | |
| 20405 | + | |
| 20406 | + | |
| 20407 | + | |
| 20408 | + | |
| 20409 | + | |
| 20410 | + | |
| 20411 | + | |
20364 | 20412 | | |
20365 | 20413 | | |
20366 | | - | |
| 20414 | + | |
20367 | 20415 | | |
20368 | 20416 | | |
20369 | 20417 | | |
20370 | 20418 | | |
20371 | 20419 | | |
20372 | 20420 | | |
20373 | 20421 | | |
20374 | | - | |
| 20422 | + | |
20375 | 20423 | | |
20376 | 20424 | | |
20377 | 20425 | | |
| |||
20387 | 20435 | | |
20388 | 20436 | | |
20389 | 20437 | | |
20390 | | - | |
| 20438 | + | |
| 20439 | + | |
| 20440 | + | |
| 20441 | + | |
| 20442 | + | |
| 20443 | + | |
| 20444 | + | |
| 20445 | + | |
| 20446 | + | |
| 20447 | + | |
| 20448 | + | |
| 20449 | + | |
| 20450 | + | |
| 20451 | + | |
| 20452 | + | |
| 20453 | + | |
| 20454 | + | |
20391 | 20455 | | |
20392 | 20456 | | |
20393 | 20457 | | |
20394 | 20458 | | |
20395 | 20459 | | |
20396 | 20460 | | |
20397 | 20461 | | |
20398 | | - | |
| 20462 | + | |
20399 | 20463 | | |
20400 | 20464 | | |
20401 | 20465 | | |
20402 | 20466 | | |
20403 | 20467 | | |
20404 | 20468 | | |
20405 | 20469 | | |
20406 | | - | |
| 20470 | + | |
20407 | 20471 | | |
20408 | 20472 | | |
20409 | 20473 | | |
20410 | 20474 | | |
20411 | 20475 | | |
20412 | 20476 | | |
20413 | 20477 | | |
20414 | | - | |
| 20478 | + | |
20415 | 20479 | | |
20416 | 20480 | | |
20417 | 20481 | | |
20418 | 20482 | | |
20419 | 20483 | | |
20420 | 20484 | | |
20421 | 20485 | | |
20422 | | - | |
| 20486 | + | |
20423 | 20487 | | |
20424 | 20488 | | |
20425 | 20489 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
173 | 173 | | |
174 | 174 | | |
175 | 175 | | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
| 176 | + | |
187 | 177 | | |
188 | 178 | | |
189 | 179 | | |
| |||
193 | 183 | | |
194 | 184 | | |
195 | 185 | | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
| 186 | + | |
207 | 187 | | |
208 | 188 | | |
209 | 189 | | |
210 | 190 | | |
211 | 191 | | |
212 | 192 | | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
213 | 211 | | |
214 | 212 | | |
215 | 213 | | |
| |||
0 commit comments