`InMemoryAdapter` loses the assigned ID between push and consume
還沒有人認領這個 Issue。
評估
研究方向
Read stubs/InMemoryAdapter.php, especially the push() implementation around lines 44–46, and trace how Worker::process() consumes messages. Check the logging middleware described in performance-tuning.md and the related behavior in issue #341. Confirm the adapter retains the assigned ID through consumption, and that the handler’s envelope behavior matches the intended interaction.
由索引模型根據 Issue 內容生成。
描述
InMemoryAdapter::push() stores the original message and returns the IdEnvelope only to the caller:
$id = count($this->messages) + $this->current;
$this->messages[] = $message; // stubs/InMemoryAdapter.php:44
return new IdEnvelope($message, $id); // stubs/InMemoryAdapter.php:46
So the id exists for whoever called push(), and nowhere else:
push() returned: IdEnvelope id=0
stored in adapter: GenericMessage meta=[]
INFO: Pushed message with message type "probe" to the queue. Assigned ID #0.
INFO: Processing message without ID.
Anything reading the id at consume time gets null for every message that went through this adapter — Worker::process() itself, and the logging middleware the guide suggests in performance-tuning.md. Meanwhile status($id) does answer for that id, so the two halves of the adapter disagree about whether the message has one.
Storing the envelope instead ($this->messages[] = new IdEnvelope($message, $id)) would make them agree, and would make the stub behave like an adapter that persists what it returns.
Note this interacts with #341: once the envelope is what gets stored, the handler starts receiving an IdEnvelope on the in-memory path too, which is the behaviour that issue is about.
- 主要語言
- PHP
- 星號
- 61
- 分支
- 31
- PR 合併指標
- 30 天內沒有已合併 PR
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
yiisoft/queue 的其他 Issue
-
難度 5/5 一週以上 新手友好度 35/100
-
難度 5/5 一週以上 新手友好度 35/100
-
難度 4/5 1-2 天 新手友好度 47/100
-
難度 5/5 一週以上 新手友好度 35/100
-
難度 4/5 3-5 天 新手友好度 45/100
相似的 Issue
-
enhancement good first issue help wanted
難度 2/5 1-3 小時 新手友好度 82/100
-
backend gamification P0
難度 2/5 1-3 小時 新手友好度 66/100
semanadeinformatica/website#461 ·
-
HttpRequestTrait fatals on WordPress 7.2: $blocked_http_requests clashes with WP_UnitTestCase_Base未關閉
難度 2/5 1-3 小時 新手友好度 72/100
-
Invalid or expired state when the OAuth state is longer than 156 characters可能已有人在做 關聯的 PR 仍在進行中或已合併。 未關閉
難度 2/5 1-3 小時 新手友好度 75/100
-
難度 1/5 1 小時以內 新手友好度 82/100