feat: add blocking_subscribe field to PUT/GET contract requests#50
Merged
iduartgomez merged 2 commits intomainfrom Feb 6, 2026
Merged
feat: add blocking_subscribe field to PUT/GET contract requests#50iduartgomez merged 2 commits intomainfrom
iduartgomez merged 2 commits intomainfrom
Conversation
Add a `blocking_subscribe: bool` field to both `ContractRequest::Put` and `ContractRequest::Get` to allow clients to request blocking (synchronous) subscriptions. When true, the operation response waits for the subscription to complete rather than firing it asynchronously. The field defaults to `false` in both FlatBuffers (wire format) and serde (JSON), preserving full backward compatibility with existing clients. Changes: - FlatBuffers schema: added `blocking_subscribe:bool` to Put and Get tables - ContractRequest enum: added field with `#[serde(default)]` - Updated TryFromFbs, into_owned, Display implementations - Regenerated FlatBuffers bindings
This was referenced Feb 6, 2026
iduartgomez
added a commit
to freenet/river
that referenced
this pull request
Feb 6, 2026
Add `blocking_subscribe: false` to all ContractRequest::Put and ContractRequest::Get constructors to match the new field added in freenet-stdlib 0.1.33 (freenet/freenet-stdlib#50).
iduartgomez
added a commit
to freenet/river
that referenced
this pull request
Feb 6, 2026
Add `blocking_subscribe: false` to all ContractRequest::Put and ContractRequest::Get constructors to match the new field added in freenet-stdlib 0.1.33 (freenet/freenet-stdlib#50).
iduartgomez
added a commit
to freenet/river
that referenced
this pull request
Feb 6, 2026
Add `blocking_subscribe: false` to all ContractRequest::Put and ContractRequest::Get constructors to match the new field added in freenet-stdlib 0.1.33 (freenet/freenet-stdlib#50).
iduartgomez
added a commit
to freenet/river
that referenced
this pull request
Feb 6, 2026
…ld (#80) Add `blocking_subscribe: false` to all ContractRequest::Put and ContractRequest::Get constructors to match the new field added in freenet-stdlib 0.1.33 (freenet/freenet-stdlib#50).
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.
Problem
When clients use
subscribe=trueon PUT/GET operations, subscriptions happen asynchronously (fire-and-forget). The client gets an immediate response but has no guarantee the subscription succeeded. This was identified in issues freenet/freenet-core#2506 and freenet/freenet-core#2539.The blocking subscription infrastructure already exists in freenet-core (
start_subscription_request_blocking(),start_subscription_after_put()with ablocking_subscription: boolparameter), but it was always hardcoded tofalsewith TODO comments saying the value should come fromContractRequestonce stdlib is updated.Solution
Add a
blocking_subscribe: boolfield to bothContractRequest::PutandContractRequest::Get:blocking_subscribe:bool;toPutandGettables. FlatBuffers bools default tofalse, making this fully backward-compatible on the wire.#[serde(default)] blocking_subscribe: boolto both variants, ensuring backward-compatible JSON deserialization.TryFromFbs,into_owned(), and test match arms.flatc(not manually edited).When
blocking_subscribeisfalse(default), behavior is identical to today. Whentrueandsubscribeis alsotrue, freenet-core will wait for the subscription to complete before returning the PUT/GET response to the client.Testing
cargo testpasses in freenet-stdlibFixes
Related to freenet/freenet-core#2506 and freenet/freenet-core#2539