fix: correct RCH topic subscriptions and diagnostics - #234
Conversation
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 38ca474a72
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if !self.topics.contains_key(topic_id) { | ||
| return Err(RchCoreError::InvalidPayload(format!( | ||
| "subscriber invariant violation: topic '{topic_id}' is missing" | ||
| ))); |
There was a problem hiding this comment.
Allow compatibility subscribers without topics
When /Subscriber or /Subscriber/Add creates a record with an omitted or unknown TopicID—which create_subscriber_record still permits via unwrap_or_default() without checking state.topics—the subscriber is persisted and later included by load_r3akt_read_snapshot; this new rejection then makes with_r3akt_core and full-snapshot r3akt_command requests return 500. The same failure affects pre-v3 databases containing orphan subscribers left by the previous topic-deletion behavior. Repair or exclude these compatibility rows during migration/snapshot construction, or validate them at the northbound route before enforcing this invariant.
AGENTS.md reference: AGENTS.md:L132-L137
Useful? React with 👍 / 👎.
Summary
/Topic,/Subscriber, Python-shaped fields, snapshot, MessagePack, fan-out, and UI-facing contracts.Verification
cargo fmt --all -- --checkcargo clippy --workspace --all-targets -- -D warningscargo test --workspace(all executed tests passed; one existing external-mesh test ignored)UI files were not changed, so UI checks were not required.