Repository navigation
Answer the requests a receiver does not serve - #71
Open
gwendalsimon wants to merge 1 commit into
Open
gwendalsimon wants to merge 1 commit into
gwendalsimon wants to merge 1 commit into
Conversation
The subscriber facade dropped every request a peer opened: the session raised it and waited for an answer that never came, until the session ended. A relay that announces its namespaces with PUBLISH_NAMESPACE to each peer was left without the REQUEST_OK or REQUEST_ERROR that draft 18 section 6.2 (section 4.1 in drafts 22 and 23) requires. * moq_sub_tick now refuses the seven request kinds a subscriber does not serve, as the publisher facade's pub_refuse_unserved does: DOES_NOT_EXIST for SUBSCRIBE and TRACK_STATUS, NOT_SUPPORTED for PUBLISH_NAMESPACE, SUBSCRIBE_NAMESPACE, SUBSCRIBE_TRACKS, PUBLISH and FETCH (which the publisher serves). * A refusal the session cannot take yet is held, in arrival order, and sent on a later tick. The queue holds one entry per request the session can have open, sized at moq_sub_create. * The pending checks mirror pub_answer_pending. Sharing them between the two facades is left to a follow-up. * Tests: on drafts 18 and 22, one request of each kind gets exactly one refusal with the expected code; with a session limited to four actions, refusals are held after the first tick and sent on the next. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
A receiving application built on moq5 (the
moq_sub_*API) now answers every request a peer sends that it does not serve. Before, these requests were never answered and stayed open until the session ended. SUBSCRIBE and TRACK_STATUS get DOES_NOT_EXIST, and the other five kinds (PUBLISH_NAMESPACE, SUBSCRIBE_NAMESPACE, SUBSCRIBE_TRACKS, PUBLISH, and FETCH) get NOT_SUPPORTED, as the publisher API already does. An answer the session cannot send yet is sent on a later tick.moq-relay announces its namespaces to its peers, and our receiver never answered (openmoq/moq2ts#70).
The checks repeat the publisher API's. Both could share one helper in a follow-up, if you prefer.
I tested it in November 2026 on drafts 18 and 22, including answers held while the session was busy. The full test suite passes.
This change is