(messageId: string, req: EditMessageRequest)
| 129 | }) |
| 130 | ); |
| 131 | this.sendQueues.set(req.conversationId, next); |
| 132 | // Best-effort cleanup so the map doesn't grow unbounded for long-lived |
| 133 | // clients. Only clear if this send is still the tail. |
| 134 | const cleanup = (): void => { |
| 135 | if (this.sendQueues.get(req.conversationId) === next) { |
| 136 | this.sendQueues.delete(req.conversationId); |
| 137 | } |
| 138 | }; |
| 139 | void next.then(cleanup, cleanup); |
| 140 | return next; |
| 141 | } |
| 142 |
no test coverage detected