fix: cancel queued messages and preserve question answers - #88
Draft
andrebrait wants to merge 3 commits into
Draft
andrebrait wants to merge 3 commits into
andrebrait wants to merge 3 commits into
Conversation
Contributor
|
I noticed this issue too! Impressive PR. I'm telling you, you could join the OMP dev team. Would have made this PR smaller :) |
Contributor
Author
|
@noor-latif I do have a few PRs open to bring the required changes to OMP too :) |
Contributor
Author
|
@noor-latif and part of the reason this PR looks so big is because it is technically stacked on top of #67. Let me make that explicit :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stack: #67 → #88
Stacked on #67. Merge #67 first; this PR adds queue cancellation and question-answer preservation on top of its native queue-promotion implementation.
Both PRs currently target
main, so this PR’s Files changed tab also includes the #67 implementation. After #67 merges, rebase this branch ontomainso only this layer remains in the diff.GitHub’s native stack registration is unavailable for these cross-fork PRs: it currently requires all branches to be in the same repository. This section records the explicit dependency and merge order; it does not indicate native stack membership.
Summary
Contributor's reported symptoms:
The contributor also reported intermittent clearing of the question dialog's free-text answer. The cause was a reset effect keyed to request-object identity rather than question ID.
Explicit prerequisites and overlap
Draft: native RPC prerequisites are not yet in an official OMP release. Cancellation is provided by can1357/oh-my-pi#11872. Promotion is provided by can1357/oh-my-pi#11618.
This PR builds on the existing implementation proposed in #67: real native promotion, ref-serialized queue updates, delivery-before-acknowledgement bookkeeping and the StrictMode alive-state correction. It is the next layer, not a replacement for #67. Native Delete cannot safely follow a cosmetic-only Steer label because that would address the wrong backend queue. Review and merge #67 first, then the additional changes here; this does not introduce unrelated layout, provider, selection or integration patches.
Unsupported runtimes report an error and keep the queue item. There is no abort/resend fallback.
Verification
Copilot/CodeRabbit review requests are routed only to companion PRs in our forks, not to this upstream PR.
Companion automated-review PR (Copilot/CodeRabbit run only in our fork): andrebrait#21
Promotion acknowledgement correction
Successful native promotions now update the session-scoped persisted mirror even after unmount/navigation. Shared pending ownership also protects a remounted delivery-before-ACK case from promoting the next duplicate. The remount, observer, subsequent Delete, duplicate, and unobserved-session regressions failed before this correction and pass afterward. Both feature variants pass 41 focused hook/composer/dialog tests; the refreshed clean deployment passed 682 tests with one existing skip. All README feature descriptions now match native cancellation semantics.
Final review corrections
finallytimer dismissed a question after a rejected response. It now dismisses only after success, preserving the pending question and answer for retry. The original periodic while-typing issue was same-ID SSE replay, not this timer.Verification: 58 focused hook/composer/dialog/draft/real-RpcProcess tests pass, plus TypeScript and ESLint, in both the upstream port and integration feature. The test-renderer migration nit remains with existing upstream #85 rather than adding a second test framework in this fix.