Repository navigation
fix(memory_persistent): prevent double-forward of questions and answers (#1682 to stage) - #2353
Conversation
…rs (#1682) * fix(memory_persistent): prevent double-forward of questions and answers * test(memory_persistent): assert preventDefault is called on explicit forwards * docs(memory_persistent): note preventDefault() unreachability and test stub caveat * fix(memory_persistent): cover all six exits with delivery-count tests - Every exit of `writeQuestions` and `writeAnswers` now ends in `return self.preventDefault()`. The separate `return` after `preventDefault()` could never run, because `preventDefault()` raises. - `test_node.py`: two tests for the invalid `session_id` paths, which no test reached before. Removing `preventDefault()` from either path now fails a test. - `test_lane_forward_once_nodes.py`: six delivery-count cases, one per exit (no store, invalid session, normal path), under the engine's forward rule. On the normal path, only the enriched or stored copy reaches downstream, never the original. - Docstrings in `IInstance.py` now document their arguments. --------- Co-authored-by: Alexandru Sclearuc <asclearuc@gmail.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 🗂️ Base branches to auto review (2)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🤖 Internal: Discord sync markerAuto-managed by the Discord notification workflow. Stores the linked Discord message ID and forum thread ID. Do not edit or delete. |
Summary (stage)
writeQuestions/writeAnswersexplicitly forwarded viaself.instance.write*()without callingpreventDefault(), so the engine's automatic default action also ran afterward, delivering every question and answer twicememory_contextattached and one withoutreturn self.preventDefault()on every explicit-forward path in both methods (all six exits).preventDefault()raises, and that is what suppresses the engine's default forward, so it is the last statement on each path. The_make_instancetest fixture stubspreventDefaultso the unit tests can call the handlers directly; delivery counts are checked innodes/test/test_lane_forward_once_nodes.py, whose stub raises like the real one.Type
fix
Testing
./builder testpassesRan
./builder nodes:test(not the full./builder test) via the real compiled engine: 2162 passed, 64 skipped, 0 failed.Checklist
Linked Issue
Fixes #1638